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

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 typeAliasespg_oidLevelNotes
BOOLEANBOOL16StableTRUE / FALSE / NULL
SMALLINTINT221Baseline16-bit signed
INTEGERINT, INT423Stable32-bit signed
BIGINTINT820Stable64-bit signed
REALFLOAT4700BaselineSingle precision
DOUBLE PRECISIONFLOAT8701StableDouble precision
NUMERICDECIMAL1700BaselineExact number (Decimal-backed); strict parse on explicit cast
TEXT25StableVariable-length string
VARCHAR(n)CHARACTER VARYING1043BaselineBounded string (text-backed)
CHAR(n)BPCHAR, CHARACTER1042BaselineFixed-length string (text-backed)
MVARCHAR(n)46001Baseline1C-compatible national VARCHAR: UTF-16LE semantics, case- and trailing-space-insensitive comparison, custom index-key normalization
BYTEA17StableVariable-length binary string
UUID2950BaselineExplicit casts only; invalid text → 22P02
DATE1082BaselineText-backed; minimal validation
TIMESTAMP1114BaselineDate-time without time zone (text-backed)
TIMESTAMPTZ1184BaselineParsed 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.
  • TIMESTAMP is serialized in UTC without offset (2026-05-07 14:30:00.123); trailing microsecond zeros are truncated.
  • BRIN indexes on date / timestamp / timestamptz are 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 typepg_oidStatus
TIME1083Planned
INTERVAL1186Planned
JSON114Planned (functions json_agg / json_build_object return text)
JSONB3802Planned

NULL handling

  • All types allow NULL unless the column is declared 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 casts:

SELECT '42'::INTEGER;
SELECT id::TEXT FROM t;
SELECT '550e8400-e29b-41d4-a716-446655440000'::UUID;

Expected SQLSTATE

SituationSQLSTATE
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 LAST0A000