Skip to content
Discord Get Started

Compatibility Matrix

DB9 implements a PostgreSQL-compatible SQL engine over TiKV distributed storage. Most PostgreSQL clients, ORMs, and drivers work without changes. This page documents where DB9 matches PostgreSQL, where it diverges, and what is not available.

Use this matrix when evaluating DB9 for a new project or migrating an existing PostgreSQL application.

CategoryCoverageNotes
SQL DML (SELECT, INSERT, UPDATE, DELETE)FullJOINs, CTEs, window functions, subqueries, upsert, RETURNING
SQL DDL (CREATE, ALTER, DROP)Near-fullNo partitioning, table inheritance, or foreign data wrappers
Data types20+ typesAll common types; no XML, CIDR/INET, range types
IndexesB-tree + HNSW fullGIN/GiST/Hash/SP-GiST/BRIN accepted but fall back to table scan
TransactionsFullSERIALIZABLE accepted but runs as REPEATABLE READ
Built-in functions200+String, math, date/time, JSON/JSONB, array, aggregate, window, FTS
Wire protocolpgwire v3Simple Query, Extended Query, COPY, prepared statements
ORM compatibility99%+Prisma, Drizzle, Sequelize, Knex, TypeORM, GORM, SQLAlchemy tested
System catalogs50+ viewspg_catalog, information_schema, cron schema
Extensions9 built-inhttp, fs9, pg_cron, vector, embedding, uuid-ossp, hstore, parquet, zhparser
PL/pgSQLPartialBasics supported; no EXECUTE, exception handling, WHILE loops
ReplicationNoneNo logical or streaming replication
FeatureStatus
SELECT with FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT/OFFSETSupported
DISTINCT / DISTINCT ONSupported
JOINs (INNER, LEFT, RIGHT, FULL OUTER, CROSS)Supported
Subqueries (correlated, scalar, EXISTS, IN)Supported
CTEs (WITH … AS)Supported
Recursive CTEs (WITH RECURSIVE)Supported
Set operations (UNION, INTERSECT, EXCEPT)Supported
Window functions (ROW_NUMBER, RANK, LAG, LEAD, etc.)Supported
INSERT with VALUES, SELECT, DEFAULT, RETURNINGSupported
INSERT ON CONFLICT (upsert)Supported
UPDATE with WHERE, subqueries, RETURNINGSupported
DELETE with WHERE, subqueries, RETURNINGSupported
CASE expressionsSupported
COPY (CSV, TEXT)Supported (BINARY format not supported)
EXPLAIN / EXPLAIN ANALYZESupported (plan-only; ANALYZE shows plan without runtime stats)
LATERAL joinsSupported
FeatureStatus
CREATE/ALTER/DROP TABLESupported
Column constraints (PRIMARY KEY, UNIQUE, NOT NULL, DEFAULT, CHECK)Supported
Foreign keys (CASCADE, SET NULL, SET DEFAULT, RESTRICT, NO ACTION)Supported
Generated columnsSupported
SERIAL / BIGSERIALSupported
CREATE/DROP INDEX (B-tree, HNSW)Supported
CREATE INDEX CONCURRENTLYSupported
Expression indexes, partial indexesSupported
CREATE/DROP VIEWSupported
CREATE/DROP MATERIALIZED VIEW, REFRESH MATERIALIZED VIEWSupported
CREATE/DROP SEQUENCESupported
CREATE/ALTER TYPE (enum)Supported
CREATE/DROP SCHEMASupported
CREATE/DROP FUNCTION (PL/pgSQL)Supported
CREATE/DROP TRIGGER (BEFORE/AFTER, row/statement level)Supported
TRUNCATESupported
Table partitioning (RANGE, LIST, HASH)Not supported
Table inheritanceNot supported
Foreign data wrappers (FDW)Not supported
TablespacesNot supported (TiKV manages storage placement)
FeatureStatus
BEGIN / COMMIT / ROLLBACKSupported
SAVEPOINT / RELEASE / ROLLBACK TOSupported
READ COMMITTED isolationSupported (default)
REPEATABLE READ isolationSupported
SERIALIZABLE isolationAccepted but silently runs as REPEATABLE READ
READ UNCOMMITTED isolationAccepted but runs as READ COMMITTED
SET LOCAL (transaction-scoped settings)Supported
DEFERRABLE transactionsNot supported (requires SERIALIZABLE)
TypeAliasesNotes
BOOLEANBOOL
SMALLINTINT2Stored as INT4 internally
INTEGERINT, INT4
BIGINTINT8
REALFLOAT4Stored as FLOAT8 internally
DOUBLE PRECISIONFLOAT8
NUMERICDECIMALWith precision and scale, up to precision 1000
TEXTVariable-length, no limit
VARCHAR(n)CHARACTER VARYING
CHAR(n)CHARACTERStored as VARCHAR internally
BYTEABinary data
DATE
TIMEWithout time zone
TIMESTAMPWithout time zone, millisecond precision
TIMESTAMPTZWith time zone, millisecond precision
INTERVAL
JSONStored as text
JSONBCanonicalized (sorted keys, normalized whitespace)
UUID
BOOLEAN[] / INT[] / TEXT[] / etc.1-dimensional arrays of any supported type
TSVECTORFull-text search document representation
TSQUERYFull-text search query
VECTOR(n)pgvector-compatible; for HNSW indexes and distance operators
NAMEPostgreSQL identifier type
TypeNotes
XML
CIDR / INET / MACADDRNetwork address types
Range types (INT4RANGE, TSRANGE, etc.)
Composite types (user-defined row types)Enum types are supported via CREATE TYPE
Large objects (OID-based streaming)BYTEA is available for binary data
Multi-dimensional arraysOnly 1-dimensional arrays
Money
Bit string (BIT, VARBIT)
TypeStatusNotes
B-treeFullDefault. Point, range, bounded-range, in-list, expression, partial indexes
HNSWFullpgvector-compatible. L2, cosine, inner product distance metrics. k-NN via ORDER BY <operator> LIMIT k
GINSyntax onlyCREATE INDEX accepted; EXPLAIN shows GIN scan; runtime falls back to sequential scan
GiSTSyntax onlyCREATE INDEX accepted; runtime falls back to sequential scan
HashSyntax onlyCREATE INDEX accepted; runtime falls back to sequential scan
SP-GiSTSyntax onlyCREATE INDEX accepted; runtime falls back to sequential scan
BRINSyntax onlyCREATE INDEX accepted; runtime falls back to sequential scan

GIN indexes on JSONB and tsvector columns are accepted and stored. The optimizer can plan GIN scans (visible in EXPLAIN output), but the runtime execution path is not yet implemented — queries fall back to sequential scan with filter.

FeatureStatus
pgwire v3Supported
Simple Query (text)Supported
Extended Query (Parse, Bind, Describe, Execute)Supported
Binary parameter encodingSupported
COPY (CSV, TEXT)Supported (BINARY format not supported)
Prepared statementsSupported
PortalsSupported
Multiple result setsSupported
SCRAM-SHA-256 authenticationSupported (at pgwire layer)
LISTEN / NOTIFYNot supported
Logical replication protocolNot supported
Streaming replicationNot supported

DB9 implements 200+ built-in functions across these categories:

CategoryExamples
Stringupper, lower, concat, substring, replace, trim, split_part, regexp_match, format
Mathabs, ceil, floor, round, sqrt, power, log, random, trunc, trig functions
Date/Timenow, date_trunc, date_part, extract, age, to_char, to_timestamp, make_date
Aggregatecount, sum, avg, min, max, string_agg, array_agg, json_agg, bool_and/or
Windowrow_number, rank, dense_rank, lag, lead, first_value, last_value, ntile
JSON/JSONBjsonb_build_object, jsonb_set, jsonb_extract_path, jsonb_array_elements, jsonb_each, jsonb_typeof, to_jsonb, row_to_json
Arrayarray_length, array_agg, unnest, array_append, array_cat, array_position, string_to_array
Full-text searchto_tsvector, to_tsquery, plainto_tsquery, ts_rank, ts_headline, setweight
UUIDuuid_generate_v4 and related functions
Type conversioncast, to_char, to_number, to_date, to_timestamp
Conditionalcoalesce, nullif, greatest, least
Systemcurrent_user, current_database, current_schema, pg_typeof, version
OperatorDescriptionStatus
->Get JSON object field by key (returns JSON)Supported
->>Get JSON object field by key (returns text)Supported
@>ContainsSupported
<@Contained bySupported
?Key existsSupported
`?`Any key exists
?&All keys existSupported
``
#-Delete pathSupported
FeatureStatus
DECLARE / BEGIN / END blocksSupported
Variable assignment (:=)Supported
SELECT INTOSupported
IF / THEN / ELSIF / ELSE / END IFSupported
FOR loops (query iteration and integer range)Supported
PERFORM (execute without result)Supported
EXIT (loop termination)Supported
RAISE (NOTICE, WARNING, ERROR)Supported
RETURN / RETURN NEXT / RETURN QUERYSupported
RETURNS TABLE syntaxSupported
WHILE loopsNot supported
CASE statements (in PL/pgSQL)Not supported
Exception handling (BEGIN…EXCEPTION)Not supported
Dynamic SQL (EXECUTE)Not supported
Cursor operations (FOR…IN CURSOR)Not supported

Other procedural languages (PL/Python, PL/Perl, PL/v8) are not supported.

DB9 is tested against major ORMs with a combined pass rate above 99%:

ORM / DriverTested VersionPass RateNotes
Prisma5.7+100% (89/89)Binary wire protocol; $queryRaw for advanced SQL
Drizzle0.29+100% (75/75)Type-safe queries; full query builder support
Sequelize6.35+100% (87/87)Raw queries for window/CTE features
Knex.js3.1+100% (97/97)Full query builder, window functions, CTEs
TypeORM0.3.17+98% (147/150)3 tests skipped (schema introspection edge cases)
node-postgres (pg)8.11+FullNative pgwire client
SQLAlchemy2.0+TestedJSONB operators, RETURNING, transaction patterns
GORM (Go)1.25+TestedCRUD, transactions, foreign keys

Known ORM limitations:

  • Schema introspection queries may return incomplete results for some ORMs that rely heavily on information_schema
  • Some ORMs assume PostgreSQL-specific system functions that are not yet implemented

DB9 implements 50+ virtual tables across pg_catalog, information_schema, and extension schemas.

ViewStatusNotes
pg_classSupportedRelations (tables, views, indexes, sequences)
pg_attributeSupportedColumn definitions
pg_indexSupportedIndex metadata
pg_constraintSupportedConstraints (PK, FK, UNIQUE, CHECK)
pg_typeSupportedData types
pg_procSupportedFunctions and procedures
pg_namespaceSupportedSchemas
pg_roles / pg_userSupportedUsers and roles
pg_databaseSupportedDatabase metadata
pg_sequenceSupportedSequence state
pg_attrdefSupportedColumn defaults
pg_extensionSupportedInstalled extensions
pg_amSupportedAccess methods
pg_triggerSupportedTrigger definitions
pg_depend / pg_descriptionSupportedObject dependencies and comments
pg_stat_user_tablesStubReturns rows but statistics columns are zeros
pg_stat_statementsNot available
pg_publication / pg_subscriptionNot availableNo logical replication
ViewStatus
columnsSupported
tablesSupported
viewsSupported
schemataSupported
table_constraintsSupported
key_column_usageSupported
check_constraintsSupported
referential_constraintsSupported
sequencesSupported
routinesSupported

DB9 includes 9 built-in extensions. Custom or third-party extensions cannot be installed.

ExtensionVersionDefaultDescription
http1.0.0YesHTTP client (GET, POST, PUT, DELETE, PATCH, HEAD)
pg_cron1.0.0YesJob scheduler with cron expressions
fs91.0.0NoFile system operations (read, write, list, glob)
vector0.8.1Nopgvector-compatible vector type and HNSW indexes
embedding1.0.0NoBuilt-in text embedding generation
uuid-ossp1.1NoUUID generation functions (functions are built-in; extension is a metadata shim)
hstore1.0NoKey-value store type (metadata shim with limited semantics)
parquet1.0.0NoParquet file import
zhparser2.0.0NoChinese full-text search tokenizer

Extensions not available: PostGIS, pg_partman, pg_stat_statements, pgcrypto, pg_trgm, ltree, citext, and all other PostgreSQL contrib extensions.

These PostgreSQL features are not available in DB9:

FeatureCategory
Table partitioning (RANGE, LIST, HASH)DDL
Table inheritanceDDL
Foreign data wrappers (FDW)DDL
TablespacesDDL
Rules (CREATE RULE)DDL
Logical replication (PUBLICATION, SUBSCRIPTION)Replication
Streaming replicationReplication
LISTEN / NOTIFYProtocol
Advisory locksLocking
Row-level security (RLS)Security
SERIALIZABLE isolation (true serializable)Transactions
DEFERRABLE transactionsTransactions
Large objects (OID-based)Data
XML typeData
Network types (CIDR, INET, MACADDR)Data
Range typesData
PL/Python, PL/Perl, PL/v8Languages
Dynamic SQL in PL/pgSQL (EXECUTE)Languages
Custom extensionsExtensions
pg_dump / pg_restore (native format)Tools
pg_basebackupTools

You can verify compatibility for your specific use case:

SQL
-- Check supported types
SELECT typname FROM pg_type WHERE typnamespace = 11 ORDER BY typname;
-- Check available extensions
SELECT * FROM pg_extension;
-- Check installed functions
SELECT proname, pronargs FROM pg_proc WHERE pronamespace = 11 ORDER BY proname;
-- Check catalog coverage
SELECT schemaname, tablename FROM pg_tables WHERE schemaname = 'pg_catalog';
-- Verify transaction isolation
SHOW default_transaction_isolation;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SHOW transaction_isolation; -- returns 'repeatable read'