On this page  
  
  
Making CockroachDB easy to use is a top priority for us, so we chose to implement SQL. However, even though SQL has a standard, no database implements all of it, nor do any of them have standard implementations of all features.
To understand which standard SQL features we support (as well as common extensions to the standard), use the table below.
- 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 ourselves or others.
- Details provides greater context about the component.
Features
Row values
| Component | Supported | Type | Details | 
|---|---|---|---|
| Identifiers | ✓ | Standard | Identifiers documentation | 
| INT | ✓ | Standard | INTdocumentation | 
| FLOAT,REAL | ✓ | Standard | FLOATdocumentation | 
| BOOLEAN | ✓ | Standard | BOOLdocumentation | 
| DECIMAL,NUMERIC | ✓ | Standard | DECIMALdocumentation | 
| NULL | ✓ | Standard | NULL-handling documentation | 
| BYTES | ✓ | CockroachDB Extension | BYTESdocumentation | 
| Automatic key generation | ✓ | Common Extension | Automatic key generation FAQ | 
| STRING,CHARACTER | ✓ | Standard | STRINGdocumentation | 
| COLLATE | ✓ | Standard | COLLATEdocumentation | 
| AUTO INCREMENT | Alternative | Common Extension | Automatic key generation FAQ | 
| Key-value pairs | Alternative | Extension | Key-Value FAQ | 
| ARRAY | ✓ | Standard | ARRAYdocumentation | 
| UUID | ✓ | PostgreSQL Extension | UUIDdocumentation | 
| JSON | ✓ | Common Extension | JSONBdocumentation | 
| TIME | ✓ | Standard | TIMEdocumentation | 
| XML | ✗ | Standard | XML data can be stored as BYTES, but we do not offer XML parsing. | 
| UNSIGNED INT | ✗ | Common Extension | UNSIGNED INTcauses numerous casting issues, so we do not plan to support it. | 
| SET,ENUM | ✗ | MySQL, PostgreSQL Extension | Only allow rows to contain values from a defined set of terms. | 
| INET | ✓ | PostgreSQL Extension | INETdocumentation | 
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 | ✓ | CockroachDB Extension | While SAVEPOINTis part of the SQL standard, we only support our extension of it | 
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 | 
| Inverted indexes | ✓ | Common Extension | Inverted Indexes documentation | 
| Multiple indexes per query | Planned | Common Extension | Use multiple indexes to filter the table's values for a single query | 
| Full-text indexes | Planned | Common Extension | GitHub issue tracking full-text index support | 
| Prefix/Expression Indexes | Potential | Common Extension | Apply expressions (such as LOWER()) to values before indexing them | 
| Geospatial indexes | Potential | Common Extension | Improves performance of queries calculating geospatial data | 
| Hash indexes | ✗ | Common Extension | Improves performance of queries looking for single, exact values | 
| Partial indexes | ✗ | Common Extension | Only index specific rows from indexed columns | 
Schema changes
| Component | Supported | Type | Details | 
|---|---|---|---|
| ALTER TABLE | ✓ | Standard | ALTER TABLEdocumentation | 
| Database renames | ✓ | Standard | RENAME DATABASEdocumentation | 
| Table renames | ✓ | Standard | RENAME TABLEdocumentation | 
| Column renames | ✓ | Standard | RENAME COLUMNdocumentation | 
| Adding columns | ✓ | Standard | ADD COLUMNdocumentation | 
| Removing columns | ✓ | Standard | DROP COLUMNdocumentation | 
| Adding constraints | ✓ | Standard | ADD CONSTRAINTdocumentation | 
| Removing constraints | ✓ | Standard | DROP CONSTRAINTdocumentation | 
| Index renames | ✓ | Standard | RENAME INDEXdocumentation | 
| Adding indexes | ✓ | Standard | CREATE INDEXdocumentation | 
| Removing indexes | ✓ | Standard | DROP INDEXdocumentation | 
Statements
| Component | Supported | Type | Details | 
|---|---|---|---|
| Common statements | ✓ | Standard | SQL Statements documentation | 
| UPSERT | ✓ | PostgreSQL, MSSQL Extension | UPSERTdocumentation | 
| EXPLAIN | ✓ | Common Extension | EXPLAINdocumentation | 
| SELECT INTO | Alternative | Common Extension | You can replicate similar functionality using CREATE TABLEand thenINSERT INTO ... SELECT .... | 
Clauses
| Component | Supported | Type | Details | 
|---|---|---|---|
| Common clauses | ✓ | Standard | SQL Grammar documentation | 
| LIMIT | ✓ | Common Extension | Limit the number of rows a statement returns. | 
| LIMITwithOFFSET | ✓ | Common Extension | Skip a number of rows, and then limit the size of the return set. | 
| RETURNING | ✓ | Common Extension | Retrieve a table of rows statements affect. | 
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) | Functional | Standard | Join expressions 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. Currently works only with small data sets. | 
| Scalar subqueries | Partial | Standard | Non-correlated subqueries are supported, as are most correlated subqueries. Currently 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 | GRANTdocumentation | 
| Privileges | ✓ | Standard | Privileges documentation | 
Miscellaneous
| Component | Supported | Type | Details | 
|---|---|---|---|
| Column families | ✓ | CockroachDB Extension | Column Families documentation | 
| Interleaved tables | ✓ | CockroachDB Extension | Interleaved Tables documentation | 
| Parallel Statement Execution | ✓ | CockroachDB Extension | Parallel Statement Execution documentation | 
| Information Schema | ✓ | Standard | Information Schema documentation | 
| Views | ✓ | Standard | Views documentation | 
| Window functions | ✓ | Standard | Window Functions documentation | 
| Common Table Expressions | Partial | Common Extension | Common Table Expressions documentation | 
| Stored Procedures | Planned | Common Extension | Execute a procedure explicitly. | 
| Cursors | ✗ | Standard | Traverse a table's rows. | 
| Triggers | ✗ | Standard | Execute a set of commands whenever a specified event occurs. | 
| Sequences | ✓ | Common Extension | CREATE SEQUENCEdocumentation |