Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Data types

Goal

Reference for supported AngaraBase data types and type casting rules.

Supported types

SQL typeAliasStorageNotes
INTEGERINT, INT432-bit signedPrimary numeric type
BIGINTINT864-bit signedLarge counters, IDs
VARCHAR(n)Variable-length textBounded by n characters
TEXTVariable-length textUnbounded text
BOOLEANBOOL1-byteTRUE / FALSE / NULL (OID 16)
TIMESTAMPText-backed compatISO 8601 UTC (OID 1114)
DATEText-backed compatISO 8601 date portion (OID 1082)

Text-backed temporal types

TIMESTAMP and DATE are stored in text-backed compatibility mode. This means:

  • Comparisons are performed as text (lexicographical); ISO 8601 format guarantees correct ordering.
  • Serialization (RM-0.6.5.5): TIMESTAMP is always serialized in UTC without offset (e.g., 2026-05-07 14:30:00.123). Trailing microsecond zeros are truncated.
  • Arithmetic (INTERVAL etc.) is not supported — 0A000.
  • BRIN indexes on date / timestamp / timestamptz columns are supported (using text min/max).

Planned types

SQL typeStatus
DECIMAL / NUMERICPlanned
UUIDPlanned

Attempting to use an unsupported type will result in a parser error or 0A000 feature_not_supported.

NULL handling

  • All types allow NULL unless the column is declared as NOT NULL.
  • In ORDER BY ASC, NULL values are treated as the largest (appear last).
  • Explicit NULLS FIRST / NULLS LAST control is not supported — 0A000.

Type casting

AngaraBase supports PostgreSQL-syntax type casting:

SELECT '42'::INTEGER;
SELECT id::TEXT FROM t;

Casting between incompatible types results in a runtime error with the corresponding SQLSTATE.

Expected SQLSTATE

SituationSQLSTATE
Unsupported type in DDL0A000
INTERVAL arithmetic0A000
NULLS FIRST / NULLS LAST0A000
Invalid castRuntime error