Data types
Reference for AngaraBase data types: what is actually supported, what is not, and
which SQLSTATE a cast returns. The source of truth is the engine’s type
registry (SQL_TYPE_REGISTRY); support levels are reconciled against it, not
against the mere presence of an OID in the virtual pg_catalog.
Supported types
Stable — production-ready, has a pinned test. Baseline — implemented and
usable, but with narrower test coverage.
| SQL type | Aliases | pg_oid | Level | Notes |
|---|---|---|---|---|
BOOLEAN | BOOL | 16 | Stable | TRUE / FALSE / NULL |
SMALLINT | INT2 | 21 | Baseline | 16-bit signed |
INTEGER | INT, INT4 | 23 | Stable | 32-bit signed |
BIGINT | INT8 | 20 | Stable | 64-bit signed |
REAL | FLOAT4 | 700 | Baseline | Single precision |
DOUBLE PRECISION | FLOAT8 | 701 | Stable | Double precision |
NUMERIC | DECIMAL | 1700 | Baseline | Exact number (Decimal-backed); strict parse on explicit cast |
TEXT | — | 25 | Stable | Variable-length string |
VARCHAR(n) | CHARACTER VARYING | 1043 | Baseline | Bounded string (text-backed) |
CHAR(n) | BPCHAR, CHARACTER | 1042 | Baseline | Fixed-length string (text-backed) |
MVARCHAR(n) | — | 46001 | Baseline | 1C-compatible national VARCHAR: UTF-16LE semantics, case- and trailing-space-insensitive comparison, custom index-key normalization |
BYTEA | — | 17 | Stable | Variable-length binary string |
UUID | — | 2950 | Baseline | Explicit casts only; invalid text → 22P02 |
DATE | — | 1082 | Baseline | Text-backed; minimal validation |
TIMESTAMP | — | 1114 | Baseline | Date-time without time zone (text-backed) |
TIMESTAMPTZ | — | 1184 | Baseline | Parsed for cast / AS OF; offset is not retained |
MVARCHAR — national VARCHAR for 1C
MVARCHAR is AngaraBase’s own type for 1C compatibility: comparison is
case-insensitive and ignores trailing ASCII spaces, length is given as
MVARCHAR(N), and a dedicated key normalization is used for indexing.
CREATE TABLE catalog (code MVARCHAR(16), name MVARCHAR(255));
-- 'Тест ' and 'тест' compare as equal
Text-backed temporal types
DATE / TIMESTAMP / TIMESTAMPTZ are stored in text-backed mode:
- Comparisons are textual (lexicographical); ISO 8601 format guarantees correct ordering.
TIMESTAMPis serialized in UTC without offset (2026-05-07 14:30:00.123); trailing microsecond zeros are truncated.- BRIN indexes on
date/timestamp/timestamptzare supported (textual min/max).
Planned (not yet available)
These types are registered in pg_catalog for introspection but are not
usable — a cast to them returns 0A000:
| SQL type | pg_oid | Status |
|---|---|---|
TIME | 1083 | Planned |
INTERVAL | 1186 | Planned |
JSON | 114 | Planned (functions json_agg / json_build_object return text) |
JSONB | 3802 | Planned |
NULL handling
- All types allow
NULLunless the column is declaredNOT 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 casts:
SELECT '42'::INTEGER;
SELECT id::TEXT FROM t;
SELECT '550e8400-e29b-41d4-a716-446655440000'::UUID;
Expected SQLSTATE
| Situation | SQLSTATE |
|---|---|
Unsupported/Planned type in DDL or cast (TIME, INTERVAL, JSON, JSONB) | 0A000 |
Invalid text on cast (e.g. into NUMERIC / UUID / float) | 22P02 |
NULLS FIRST / NULLS LAST | 0A000 |
Links
- SQL compatibility overview: overview.md
- DDL (CREATE TABLE with types): ddl.md
- Known issues: Known issues