SQL feature support

YugabyteDB supports most standard SQL features.

To understand which standard SQL features we support, refer to the following tables:

Data types

Data type Supported Documentation
ARRAY Array data types
BINARY Binary data types
BIT,BYTES
BOOLEAN Boolean data types
CHAR, VARCHAR, TEXT Character data types
COLLATE Collations
DATE, TIME, TIMESTAMP, INTERVAL Date and time data types
DEC, DECIMAL, NUMERIC Fixed point numbers
ENUM Enumerations
FLOAT, REAL, DOUBLE PRECISION Floating-point numbers
JSON, JSONB JSON data types
MONEY Money data types
SERIAL, SMALLSERIAL, BIGSERIAL Serial data types
SET
SMALLINT, INT, INTEGER, BIGINT Integers
INT4RANGE, INT8RANGE, NUMRANGE, TSRANGE, TSTZRANGE, DATERANGE Range data types
UUID UUID data type
XML
TSVECTOR
UDT(Base, Enumerated, Range, Composite, Array, Domain types)

Schema operations

Operation Supported Documentation
Altering tables ALTER TABLE
Altering databases ALTER DATABASE
Altering columns
Altering a column's data type
Adding columns ADD COLUMN
Removing columns DROP COLUMN
Adding constraints ADD CONSTRAINT
Removing constraints DROP CONSTRAINT
Altering indexes
Adding indexes CREATE INDEX
Removing indexes
Altering a primary key
Adding user-defined schemas CREATE SCHEMA
Removing user-defined schemas
Altering user-defined schemas

Constraints

Feature Supported Documentation
Check Check constraint
Unique Unique constraint
Not Null Not Null constraint
Primary Key Primary keys
Foreign Key Foreign keys
Default Value
Deferrable Foreign Key constraints
Deferrable Primary Key and Unique constraints
Exclusion constraints

Indexes

Component Supported Documentation
Indexes Indexes and constraints
GIN indexes GIN indexes
Partial indexes Partial indexes
Expression indexes Expression indexes
Multi-column indexes
Covering indexes Covering indexes
Prefix indexes Implement using Expression indexes
Spatial indexes
Multiple indexes per query
Full-text indexes
GiST indexes
BRIN indexes

Transactions

Feature Supported Documentation
Transactions Transactions
BEGIN BEGIN
COMMIT COMMIT
ROLLBACK ROLLBACK
SAVEPOINT SAVEPOINT
ROLLBACK TO SAVEPOINT ROLLBACK TO SAVEPOINT

Roles and Permissions

Component Supported Details
Users Manage users and roles
Roles Manage users and roles
Object ownership
Privileges Grant privileges
Default privileges

Queries

Component Supported Details
FROM, WHERE, GROUP BY, HAVING, DISTINCT, LIMIT/OFFSET, WITH queries Group data
EXPLAIN query plans Analyze queries with EXPLAIN
JOINs (INNER/OUTER, LEFT/RIGHT) Join columns
Expressions and Operators Expressions and operators
Common Table Expressions (CTE) and Recursive Queries Recursive queries and CTEs
Upserts (INSERT ... ON CONFLICT DO NOTHING/UPDATE) Upsert

Advanced SQL

Component Supported Details
Stored procedures Stored procedures
User-defined functions Functions
Cursors Cursors
Row-level triggers (BEFORE, AFTER, INSTEAD OF)
Statement-level triggers (BEFORE, AFTER, INSTEAD OF)
Deferrable triggers
Transition tables (REFERENCING clause for triggers)
Sequences Auto-Increment column values
Identity columns
Views Views
Materialized views Materialized views
Window functions Window functions
Common table expressions
Extensions PostgreSQL extensions
Foreign data wrappers Foreign data wrappers