SQL compatibility overview
Goal
Понять модель совместимости AngaraBase с PostgreSQL и быстро интерпретировать ошибки при тестировании.
Approach
AngaraBase реализует ограниченное подмножество PostgreSQL SQL через pgwire-протокол.
Неподдерживаемые конструкции возвращают явный SQLSTATE (чаще всего 0A000 feature_not_supported), а не
молчаливый некорректный результат.
Принцип: fail-closed — если feature не реализован, клиент получает детерминированную ошибку.
Source of truth
| Источник | Путь |
|---|---|
| Known issues (canonical) | angarabook/src/operations/known-issues.md |
| Compat probes (tests) | tools/compat_suite/run.sh |
| User-facing known issues | Known issues |
Practical advice
- ORM/tooling (DBeaver, psql, Hibernate и др.) часто выполняют
pg_catalogзапросы при подключении. Ориентируйтесь на результаты compat suite режимов--dbeaver-smoke/--nightly. - Если вы наблюдаете hang/stall — это P0/P1 bug. Соберите артефакты по инструкции в Support.
SQLSTATE quick reference
| SQLSTATE | Name | Typical scenario |
|---|---|---|
0A000 | feature_not_supported | WITH RECURSIVE, complex RLS predicates, multi-column ON CONFLICT target, ON CONFLICT ON CONSTRAINT |
23514 | check_violation | Partition routing: no matching partition and no DEFAULT |
42809 | wrong_object_type | UPDATE/DELETE on append-only table; PK/FK update under no_delete |
22023 | invalid_parameter_value | Invalid stats_level_max, invalid break-glass TTL, setval value out of [MINVALUE..MAXVALUE] |
42501 | insufficient_privilege | Missing roles for security operations, no SecurityContext |
25001 | active_sql_transaction | SET SESSION CONTEXT inside an active transaction |
2200H | sequence_generator_limit_exceeded | nextval past MAXVALUE/MINVALUE without CYCLE (RM-0.6.3.7) |
55000 | object_not_in_prerequisite_state | currval(seq) before any nextval in the current session (RM-0.6.3.7, session-bound contract) |
42P07 | duplicate_object | CREATE SEQUENCE of an existing name without IF NOT EXISTS |
42P01 | undefined_table | DROP SEQUENCE / nextval / currval / setval on a missing sequence |
428C9 | generated_always | INSERT with explicit non-NULL into a GENERATED ALWAYS AS IDENTITY column |
Полный список с контекстом: Known issues.
SQL reference pages
Текущий статус подсистем SQL на ветке 0.6.x. Бэйджи отражают, насколько подсистема покрыта pinned-тестами
compat-suite и можно ли на неё опираться в production-сценариях.
| Тема | Страница | Статус |
|---|---|---|
| Типы данных | data-types.md | Stable |
| DDL (CREATE, ALTER, DROP) | ddl.md | Stable |
| DML (INSERT, UPDATE, DELETE) | dml.md | Stable |
| Запросы (CTE, JOIN, ORDER BY) | queries.md | Stable |
| Секционирование таблиц | partitioning.md | Baseline |
SQL Functions (RM-0.6.5.5)
AngaraBase implements a subset of PostgreSQL built-in functions.
| Function | Signature | Description |
|---|---|---|
NOW() | () → timestamp | Current UTC time |
CURRENT_TIMESTAMP | () → timestamp | Alias for NOW() |
date_trunc(field, ts) | (text, timestamp) → timestamp | Truncate timestamp to field. Supported fields: microseconds, milliseconds, second, minute, hour, day, week, month, quarter, year, decade, century, millennium. Unknown field returns NULL. |
set_config(name, val, local) | (text, text, bool) → text | Stub: returns val. Used for Django compatibility. |
obj_description(oid, cat) | (oid, text) → text | Stub: returns NULL. Used for Django introspection. |
Vector execution visibility
When vector execution mode allows vector path (ANGARABASE_SQL_EXECUTION_MODE=auto for supported plans, or
force_vector), EXPLAIN surfaces vector operator names:
VectorSeqScanVectorFilterVectorProjectVectorHashJoinVectorAgg
If the plan shape is not supported by AngaraVector, planner/executor keeps row operators in EXPLAIN.
Execution mode behavior:
auto(default) — Stable use vector only for fully supported plan shapes, otherwise deterministic row fallback.force_row— Stable always use row executor.force_vector— Experimental fail-closed withfeature_not_supportedif vector execution is not possible. Подходит для целевого тестирования векторного пути; не рекомендуется для production-нагрузки в0.6.x.
AngaraMemory table options
CREATE TABLE ... WITH (...) now supports bounded memory-table surfaces:
storage='memory'— Baseline selects AngaraMemory table engine.durability='none'|'logged'|'snapshotted'— Baseline volatile/durable behavior.max_rows=<n>— Stable hard row-cap; overflow is fail-closed (54023).eviction_policy='error'|'fifo'— Experimental defaulterror;fifois opt-in.checkpoint_interval_ms=<n>— Baseline valid only withdurability='snapshotted'.
If max_rows is omitted for memory tables, bounded default is applied from instance policy.
Behavior clarification for durability='snapshotted':
- DML hot path does not perform immediate page persistence.
- Checkpoint worker applies per-table scheduling using each table’s
checkpoint_interval_ms(with bounded fallback).
Links
- Known issues: Known issues
- Support: Support
- Security model: Security / authorization