Data types
Goal
Reference for supported AngaraBase data types and type casting rules.
Supported types
| SQL type | Alias | Storage | Notes |
|---|---|---|---|
INTEGER | INT, INT4 | 32-bit signed | Primary numeric type |
BIGINT | INT8 | 64-bit signed | Large counters, IDs |
VARCHAR(n) | — | Variable-length text | Bounded by n characters |
TEXT | — | Variable-length text | Unbounded text |
BOOLEAN | BOOL | 1-byte | TRUE / FALSE / NULL (OID 16) |
TIMESTAMP | — | Text-backed compat | ISO 8601 UTC (OID 1114) |
DATE | — | Text-backed compat | ISO 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):
TIMESTAMPis always serialized in UTC without offset (e.g.,2026-05-07 14:30:00.123). Trailing microsecond zeros are truncated. - Arithmetic (
INTERVALetc.) is not supported —0A000. - BRIN indexes on
date/timestamp/timestamptzcolumns are supported (using text min/max).
Planned types
| SQL type | Status |
|---|---|
DECIMAL / NUMERIC | Planned |
UUID | Planned |
Attempting to use an unsupported type will result in a parser error or 0A000 feature_not_supported.
NULL handling
- All types allow
NULLunless the column is declared asNOT NULL. - In
ORDER BY ASC,NULLvalues are treated as the largest (appear last). - Explicit
NULLS FIRST/NULLS LASTcontrol 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
| Situation | SQLSTATE |
|---|---|
| Unsupported type in DDL | 0A000 |
INTERVAL arithmetic | 0A000 |
NULLS FIRST / NULLS LAST | 0A000 |
| Invalid cast | Runtime error |
Links
- SQL compatibility overview: overview.md
- DDL (CREATE TABLE with types): ddl.md
- Known issues: Known issues