On this page  
  
  
CockroachDB v25.3 supports the following standard SQL features and common extensions.
- Component lists the components that are commonly considered part of SQL.
- Supported shows CockroachDB's level of support for the component.
- Type indicates whether the component is part of the SQL Standard or is an Extension created by Cockroach Labs or others.
- Details provides greater context about the component.
Features
Row values
| Component | Supported | Type | Details | 
|---|---|---|---|
| ARRAY | ✓ | Standard | ARRAYdocumentation | 
| AUTO INCREMENT(Automatic key generation) | Alternative | Common Extension | Automatic key generation FAQ | 
| BIT | ✓ | Standard | BITdocumentation | 
| BOOLEAN | ✓ | Standard | BOOLdocumentation | 
| BYTES | ✓ | CockroachDB Extension | BYTESdocumentation | 
| COLLATE | ✓ | Standard | COLLATEdocumentation | 
| DATE | ✓ | Standard | DATEdocumentation | 
| DECIMAL,NUMERIC | ✓ | Standard | DECIMALdocumentation | 
| ENUM | ✓ | PostgreSQL Extension | ENUMdocumentation | 
| FLOAT,REAL | ✓ | Standard | FLOATdocumentation | 
| INET | ✓ | PostgreSQL Extension | INETdocumentation | 
| INT | ✓ | Standard | INTdocumentation | 
| INTERVAL | ✓ | Standard | INTERVALdocumentation | 
| JSON/JSONB | ✓ | Common Extension | JSONBdocumentation | 
| NULL | ✓ | Standard | NULL-handling documentation | 
| OID | ✓ | PostgreSQL Extension | OIDdocumentation | 
| SERIAL | ✓ | PostgreSQL Extension | SERIALdocumentation | 
| SET | ✗ | MySQL | Only allow rows to contain values from a defined set of terms. | 
| STRING,CHARACTER | ✓ | Standard | STRINGdocumentation | 
| TIME | ✓ | Standard | TIMEdocumentation | 
| TIMESTAMP/TIMESTAMPTZ | ✓ | Standard | TIMESTAMPdocumentation | 
| TSQUERY | ✓ | Standard | TSQUERYdocumentation | 
| TSVECTOR | ✓ | Standard | TSVECTORdocumentation | 
| UNSIGNED INT | ✗ | Common Extension | UNSIGNED INTcauses numerous casting issues, so we do not plan to support it. | 
| UUID | ✓ | PostgreSQL Extension | UUIDdocumentation | 
| Identifiers | ✓ | Standard | Identifiers documentation. See also SQL Name Resolution. | 
| Key-value pairs | Alternative | Extension | Key-Value FAQ | 
| XML | ✗ | Standard | XML data can be stored as BYTES, but we do not offer XML parsing. | 
Constraints
| Component | Supported | Type | Details | 
|---|---|---|---|
| Not Null | ✓ | Standard | Not Null documentation | 
| Unique | ✓ | Standard | Unique documentation | 
| Primary Key | ✓ | Standard | Primary Key documentation | 
| Check | ✓ | Standard | Check documentation | 
| Foreign Key | ✓ | Standard | Foreign Key documentation | 
| Default Value | ✓ | Standard | Default Value documentation | 
Transactions
| Component | Supported | Type | Details | 
|---|---|---|---|
| Transactions (ACID semantics) | ✓ | Standard | Transactions documentation | 
| BEGIN | ✓ | Standard | BEGINdocumentation | 
| COMMIT | ✓ | Standard | COMMITdocumentation | 
| ROLLBACK | ✓ | Standard | ROLLBACKdocumentation | 
| SAVEPOINT | ✓ | Standard with CockroachDB extensions | CockroachDB supports nested transactions using SAVEPOINT | 
Indexes
| Component | Supported | Type | Details | 
|---|---|---|---|
| Indexes | ✓ | Common Extension | Indexes documentation | 
| Multi-column indexes | ✓ | Common Extension | We do not limit on the number of columns indexes can include | 
| Covering indexes | ✓ | Common Extension | Storing Columns documentation | 
| GIN indexes | ✓ | Common Extension | GIN indexes documentation | 
| Trigram indexes | ✓ | PostgreSQL Extension | Trigram indexes documentation | 
| Partial indexes | ✓ | Common Extension | Partial indexes documentation | 
| Spatial indexes | ✓ | Common Extension | Spatial indexes documentation | 
| Multiple indexes per query | Partial | Common Extension | Index selection | 
| Full-text indexes | ✓ | Common Extension | Full-text search documentation | 
| Expression indexes | ✓ | Common Extension | Expression indexes | 
| Prefix indexes | ✗ | Common Extension | Implement using Expression indexes | 
| Hash indexes | ✗ | Common Extension | Improves performance of queries looking for single, exact values | 
| Hash-sharded indexes | ✓ | CockroachDB Extension | Hash-sharded Indexes documentation | 
Schema changes
| Component | Supported | Type | Details | 
|---|---|---|---|
| ALTER TABLE | ✓ | Standard | ALTER TABLEdocumentation | 
| Database renames | ✓ | Standard | ALTER DATABASE ... RENAME TOdocumentation | 
| Table renames | ✓ | Standard | ALTER TABLE ... RENAME TOdocumentation | 
| Column renames | ✓ | Standard | RENAME COLUMNdocumentation | 
| Altering a column's data type | ✓ | Standard | ALTER COLUMNdocumentation | 
| Adding columns | ✓ | Standard | ADD COLUMNdocumentation | 
| Removing columns | ✓ | Standard | DROP COLUMNdocumentation | 
| Adding constraints | ✓ | Standard | ADD CONSTRAINTdocumentation | 
| Removing constraints | ✓ | Standard | DROP CONSTRAINTdocumentation | 
| Index renames | ✓ | Standard | ALTER INDEX ... RENAME TOdocumentation | 
| Adding indexes | ✓ | Standard | CREATE INDEXdocumentation | 
| Removing indexes | ✓ | Standard | DROP INDEXdocumentation | 
| Altering a primary key | ✓ | Standard | ALTER PRIMARY KEYdocumentation | 
| Adding user-defined schemas | ✓ | Standard | CREATE SCHEMAdocumentation | 
| Removing user-defined schemas | ✓ | Standard | DROP SCHEMAdocumentation | 
| Altering user-defined schemas | ✓ | Standard | ALTER SCHEMAdocumentation | 
Statements
| Component | Supported | Type | Details | 
|---|---|---|---|
| Common statements | ✓ | Standard, PostgreSQL/CockroachDB Extension | SQL Statements documentation | 
| UPSERT | ✓ | PostgreSQL, MSSQL Extension | UPSERTdocumentation | 
| EXPLAIN | ✓ | Common Extension | EXPLAINdocumentation | 
| SELECT ... INTO | ✓ | Common Extension | PL/pgSQL documentation. | 
| SELECT FOR UPDATE | ✓ | Common Extension | SELECT FOR UPDATEdocumentation | 
Clauses
| Component | Supported | Type | Details | 
|---|---|---|---|
| Common clauses | ✓ | Standard | SQL Grammar documentation | 
| LIMIT | ✓ | Common Extension | Limit the number of rows a statement returns. For more information, see Limit Query Results. | 
| LIMITwithOFFSET | ✓ | Common Extension | Skip a number of rows, and then limit the size of the return set. For more information, see Limit Query Results. | 
| RETURNING | ✓ | Common Extension | Retrieve a table of rows statements affect. For examples, see the INSERTandDELETEdocumentation. | 
Table expressions
| Component | Supported | Type | Details | 
|---|---|---|---|
| Table and View references | ✓ | Standard | Table expressions documentation | 
| ASin table expressions | ✓ | Standard | Aliased table expressions documentation | 
| JOIN(INNER,LEFT,RIGHT,FULL,CROSS) | ✓ | Standard | JOINexpressions documentation | 
| Sub-queries as table expressions | Partial | Standard | Non-correlated subqueries are supported, as are most correlated subqueries. | 
| Table generator functions | Partial | PostgreSQL Extension | Table generator functions documentation | 
| WITH ORDINALITY | ✓ | CockroachDB Extension | Ordinality annotation documentation | 
Scalar expressions and Boolean formulas
| Component | Supported | Type | Details | 
|---|---|---|---|
| Common functions | ✓ | Standard | Functions calls and SQL special forms documentation | 
| Common operators | ✓ | Standard | Operators documentation | 
| IF/CASE/NULLIF | ✓ | Standard | Conditional expressions documentation | 
| COALESCE/IFNULL | ✓ | Standard | Conditional expressions documentation | 
| AND/OR | ✓ | Standard | Conditional expressions documentation | 
| LIKE/ILIKE | ✓ | Standard | String pattern matching documentation | 
| SIMILAR TO | ✓ | Standard | SQL regexp pattern matching documentation | 
| Matching using POSIX regular expressions | ✓ | Common Extension | POSIX regexp pattern matching documentation | 
| EXISTS | Partial | Standard | Non-correlated subqueries are supported, as are most correlated subqueries. Works only with small data sets. | 
| Scalar subqueries | Partial | Standard | Non-correlated subqueries are supported, as are most correlated subqueries. Works only with small data sets. | 
| Bitwise arithmetic | ✓ | Common Extension | Operators documentation | 
| Array constructors and subscripting | Partial | PostgreSQL Extension | Array expression documentation: Constructor syntax and Subscripting | 
| COLLATE | ✓ | Standard | Collation expressions documentation | 
| Column ordinal references | ✓ | CockroachDB Extension | Column references documentation | 
| Type annotations | ✓ | CockroachDB Extension | Type annotations documentation | 
Permissions
| Component | Supported | Type | Details | 
|---|---|---|---|
| Users | ✓ | Standard | Users documentation | 
| Roles | ✓ | Standard | Roles documentation | 
| Object ownership | ✓ | Common Extension | Ownership documentation | 
| Privileges | ✓ | Standard | Privileges documentation | 
| Default privileges | ✓ | PostgreSQL Extension | Default privileges documentation | 
Miscellaneous
| Component | Supported | Type | Details | 
|---|---|---|---|
| Column families | ✓ | CockroachDB Extension | Column Families documentation | 
| Computed columns (stored and virtual) | ✓ | Common Extension | Computed Columns documentation | 
| ON UPDATEexpressions | ✓ | MySQL Extension | ON UPDATEexpressions documentation | 
| Multi-region capabilities | ✓ | CockroachDB Extension | Multi-region documentation | 
| System catalog schemas | ✓ | Standard, PostgreSQL/CockroachDB Extension | crdb_internal(CockroachDB Extension)information_schema(Standard)pg_catalog(PostgreSQL Extension)pg_extension(PostgreSQL Extension) | 
| Sequences | ✓ | Common Extension | CREATE SEQUENCEdocumentation | 
| Identity columns | ✓ | Common Extension | Identity columns documentation | 
| Views | ✓ | Standard | Views documentation | 
| Materialized views | ✓ | Common Extension | Materialized views documentation | 
| Window functions | ✓ | Standard | Window Functions documentation | 
| Common table expressions | Partial | Common Extension | Common Table Expressions documentation | 
| Stored procedures | Partial | Common Extension | Stored procedures documentation | 
| Cursors | Partial | Standard | Cursors documentation | 
| Triggers | Partial | Standard | Triggers documentation | 
| Row-level TTL | ✓ | Common Extension | Automatically delete expired rows. For more information, see Batch-delete expired data with Row-Level TTL. | 
| User-defined functions | Partial | Standard | User-Defined Functions documentation | 
| CREATE EXTENSION "uuid-ossp" | ✓ | Common Extension | Provides access to several additional UUID generation functions. Note that these UUID functions are available without typing CREATE EXTENSION "uuid-ossp". CockroachDB does not have full support forCREATE EXTENSION. GitHub issue trackingCREATE EXTENSIONsupport. |