What's New in v2.0.0

April 4, 2018

With the release of CockroachDB v2.0, we’ve made significant performance improvements, expanded our PostgreSQL compatibility by adding support for JSON (among other types), and provided functionality for managing multi-regional clusters in production.

Get future release notes emailed to you:



This section summarizes the most significant user-facing changes in v2.0.0. For a complete list of features and changes, including bug fixes and performance improvements, see the release notes for previous testing releases.

Enterprise Features

These new features require an enterprise license. Register for a 30-day trial license here.

Feature Description
Table Partitioning Table partitioning gives you row-level control of how and where your data is stored. This feature can be used to keep data close to users, thereby reducing latency, or to store infrequently-accessed data on slower and cheaper storage, thereby reducing costs.
Node Map The Node Map in the Admin UI visualizes the geographical configuration of a multi-region cluster by plotting the node localities on a world map. This feature provides real-time cluster metrics, with the ability to drill down to individual nodes to monitor and troubleshoot cluster health and performance.
Role-Based Access Control Roles simplify access control by letting you assign SQL privileges to groups of users rather than to individuals.
Point-in-time Backup/Restore (Beta) Data can now be restored as it existed at a specific point-in-time within the revision history of a backup.

This is a beta feature. It is currently undergoing continued testing. Please file a Github issue with us if you identify a bug.

Core Features

These new features are freely available in the core version and do not require an enterprise license.


Feature Description
JSON Support The JSONB data type and inverted indexes give you the flexibility to store and efficiently query semi-structured data.
Sequences Sequences generate sequential integers according to defined rules. They are generally used for creating numeric primary keys.
SQL Audit Logging (Experimental) SQL audit logging gives you detailed information about queries being executed against your system. This feature is especially useful when you want to log all queries that are run against a table containing personally identifiable information (PII).

This is an experimental feature. Its interface and output are subject to change.
Common Table Expressions Common Table Expressions (CTEs) simplify the definition and use of subqueries. They can be used in combination with SELECT clauses and INSERT, DELETE, UPDATE and UPSERT statements.
Computed Columns Computed columns store data generated from other columns by an expression that's included in the column definition. They are especially useful in combination with table partitioning, JSONB columns, and secondary indexes.
Foreign Key Actions The ON UPDATE and ON DELETE foreign key actions control what happens to a constrained column when the column it's referencing (the foreign key) is deleted or updated.
Virtual Schemas For PostgreSQL compatibility, CockroachDB now supports a three-level structure for names: database name > virtual schema name > object name. The new SHOW SCHEMAS statement can be used to list all virtual schemas for a given database.
IMPORT The IMPORT statement now imports tabular data in a fully distributed fashion, and import jobs can now be paused, resumed, and cancelled.
INET The INET data type stores an IPv4 or IPv6 address.
TIME The TIME data type stores the time of day without a time zone.


Feature Description
Node Readiness Endpoint The new /health?ready=1 endpoint returns an HTTP 503 Service Unavailable status response code with an error when a node is being decommissioned or is in the process of shutting down and is therefore not able to accept SQL connections and execute queries. This is especially useful for making sure load balancers do not direct traffic to nodes that are live but not "ready", which is a necessary check during rolling upgrades.
Node Decommissioning Nodes that have been decommissioned and stopped no longer appear in Admin UI and command-line interface metrics.
Per-Replica Constraints in Replication Zones When defining a replication zone, unique constraints can be defined for each affected replica, meaning you can effectively pick the exact location of each replica.
Replication Zone for "Liveness" Range Clusters now come with a pre-defined replication zone for the "liveness" range, which contains the authoritative information about which nodes are live at any given time.
Timeseries Data Controls It is now possible to reduce the amount of timeseries data stored by a CockroachDB cluster or to disable the storage of timeseries data entirely. The latter is recommended only when using a third-party tool such as Prometheus for timeseries monitoring.

Backward-Incompatible Changes

Change Description
Replication Zones Positive replication zone constraints no longer work. Any existing positive constraints will be ignored. This change should not impact existing deployments since positive constraints have not been documented or supported for some time.
Casts from BYTES to STRING Casting between these types now works the same way as in PostgreSQL. New functions encode() and decode() are available to replace the former functionality.
NaN Comparisons NaN comparisons have been redefined to be compatible with PostgreSQL. NaN is now equal to itself and sorts before all other non-NULL values.
DROP USER It is no longer possible to drop a user with grants; the user's grants must first be revoked.
Cluster Settings The obsolete kv.gc.batch_size cluster setting has been removed.
Environment Variables The COCKROACH_METRICS_SAMPLE_INTERVAL environment variable has been removed. Users that relied on it should reduce the value for the timeseries.resolution_10s.storage_duration cluster setting instead.
Sequences As of the v1.2-alpha.20171113 release, how sequences are stored in the key-value layer changed. Sequences created prior to that release must therefore be dropped and recreated. Since a sequence cannot be dropped while it is being used in a column's DEFAULT expression, those expressions must be dropped before the sequence is dropped, and recreated after the sequence is recreated. The setval() function can be used to set the value of a sequence to what it was previously.
Reserved Keywords ROLE, VIRTUAL, and WORK have been added as reserved keywords and are no longer allowed as identifiers.

Known Limitations

For information about limitations we've identified in CockroachDB v2.0, with suggested workarounds where applicable, see Known Limitations.

Documentation Updates

Topic Description
Production Checklist This topic now provides cloud-specific hardware, security, load balancing, monitoring and alerting, and clock synchronization recommendations as well as expanded cluster topology guidance. Related deployment tutorials have been enhanced with much of this information as well.
Monitoring and Alerting This new topic explains available tools for monitoring the overall health and performance of a cluster and critical events and metrics to alert on.
Common Errors This new topic helps you understand and resolve errors you might encounter, including retryable and ambiguous errors for transactions.
SQL Performance This new topic provides best practices for optimizing SQL performance in CockroachDB.
SQL Standard Comparison This new topic lists which SQL standard features are supported, partially-supported, and unsupported by CockroachDB.
Selection Queries This new topic explains the function and syntax of queries and operations involved in reading and processing data in CockroachDB, alongside more detailed information about ordering query results, limiting query results, subqueries, and join expressions.

Yes No