What's New in v2.1.0-alpha.20180702

This version of CockroachDB is no longer supported. For more details, see the Release Support Policy.

July 2, 2018

For our July 2nd alpha release, in addition to PostgreSQL compatibility enhancements, general usability improvements, and bug fixes, we want to highlight a few major benefits:

Please give these features and the ones below a try. If you see something that can be improved, we’d love to hear from you on GitHub or the Forum.

Get future release notes emailed to you:


Backward-incompatible changes

  • CockroachDB now uses a different algorithm to generate column names for complex expressions in SELECT clauses when AS is not used. The results are more compatible with PostgreSQL but may appear different to client applications. This does not impact most uses of SQL, where the rendered expressions are sufficiently simple (simple function applications, reuses of existing columns) or when AS is used explicitly. #26550
  • The output columns for the statement SHOW CONSTRAINTS were changed. The previous interface was experimental; the new interface will now be considered stable. #26478

General changes

  • Metrics can now be sent to a Graphite endpoint specified using the external.graphite.endpoint cluster setting. The external.graphite.interval setting controls the interval at which this happens. #25227
  • Added a config file and instructions for running CockroachDB in secure mode in a Kubernetes DaemonSet. #26816

Enterprise edition changes

  • The new SHOW BACKUP RANGES and SHOW BACKUP FILES statements show details about the ranges and files, respectively, that comprise a backup. #26450

SQL language changes

  • If a computed column's expression results in an error, the name of the computed column is now added to the error returned to the user. This makes it easier for users to understand why an otherwise valid operation might fail. #26054
  • Implemented the minus operation between a JSON Object and a text array. #26183
  • Fixed some error messages to more closely match PostgreSQL error messages, including the corresponding PostgreSQL error codes. #26290
  • Added an empty pg_stat_activity virtual table for compatibility with DBeaver and other SQL clients that require it. #26249
  • The new EXPLAIN (DISTSQL, ANALYZE) statement annotates DistSQL execution plans with collected execution statistics. #25849
  • IMPORT now supports the PostgreSQL COPY format. #26334
  • The output of SHOW SESSIONS now includes the number of currently allocated bytes by the session, and the maximum number of allocated bytes that the session ever owned at once. Note that these numbers do not include the bytes allocated for the session by remote nodes. #25395
  • The bytea_output session variable now controls how byte arrays are converted to strings and reported back to clients, for compatibility with PostgreSQL. #25835
  • Added placeholder information_schema.routines and information_schema.parameters for compatibility with Navicat, PGAdmin, and other clients that require them. #26327
  • CockroachDB now recognizes aggregates in ORDER BY clauses even when there is no GROUP BY clause nor aggregation performed, for compatibility with PostgreSQL. #26425
  • Added the pg_is_in_recovery() function for compatibility with PostgreSQL tools. #26445
  • CockroachDB now supports simple forms of PostgreSQL's ROWS FROM(...) syntax. #26223
  • CockroachDB now generates a simple column name when using an SRF that produces multiple columns. #26223
  • CockroachDB now properly handles some uses of multiple SRFs in the same SELECT clause in a way compatible with PostgreSQL. #26223
  • Added the pg_is_xlog_replay_paused() function for compatibility with PostgreSQL tools. #26462
  • Added the pg_catalog.pg_seclabel and pg_catalog.pg_shseclabel tables for compatibility with Postgres tools. Note that we do not support adding security labels. #26515
  • CockroachDB now supports INSERT ... ON CONFLICT DO NOTHING without any specified columns; on a conflict with any UNIQUE column, the insert will not continue. #26465
  • CockroachDB now supports the bit_length(), quote_ident(), quote_literal(), and quote_nullable() built-in functions, and the aliases char_length() and character_length() for length(), for compatibility with PostgreSQL. #26586
  • If a function name is typed in with an invalid schema or invalid case, the error message now tries to provides a suggestion for alternate spelling. #26588
  • CockroachDB now can evaluate set-generating functions with arguments that refer to the FROM clause. In particular, this makes it possible to use functions like json_each() and json_object_keys() over JSONB columns. #26503
  • Added prototype support for IMPORT ... MYSQLDUMP, including the ability to import entire (multi-table) mysqldump files. #26164
  • CHECK constraints are now checked when updating a conflicting row in INSERT ... ON CONFLICT DO UPDATE statements. #26642
  • Labeled tuples can now be accessed using their labels (e.g., SELECT (x).word FROM (SELECT pg_expand_keywords() AS x) or a star (e.g., SELECT (x).* FROM (SELECT pg_expand_keywords() AS x)). #26628
  • An error is now returned to the user instead of panicking when trying to add a column with a UNIQUE constraint when that column's type is not indexable. #26684
  • Introduced the sql.failure.count metric, which counts the number of queries that result in an error. #26731
  • Added support for de-compressing IMPORT files with gzip or bzip. #26796
  • Added initial support for IMPORT with pg_dump files. #26740
  • Added the like_escape(), ilike_escape(), not_like_escape(), not_ilike_escape(), similar_escape(), and not_similar_escape() built-in functions for use when an optional ESCAPE clause is present. #26176
  • Added support for set-returning functions in distributed SQL execution. #26739
  • Added a cluster setting to enable the experimental cost-based optimizer. #26299
  • Added the pg_catalog.pg_shdescription table for compatibility with PostgreSQL tools. Note that CockroachDB does not support adding descriptions to shared database objects. #26474

Command-line changes

  • cockroach quit now emits warning messages on its standard error stream, not standard output. #26158
  • cockroach sql now recognizes the values on, off, 0, 1, true and false to set client-side boolean parameters with \set. #26287
  • cockroach sql now recognizes \set option=value as an alias to \set option value. #26287
  • cockroach demo now supports more options also supported by cockroach sql, including --execute, --format, --echo-sql and --safe-updates. #26287
  • cockroach demo includes the welcome messages also printed by cockroach sql. #26287
  • cockroach demo now uses the standard defaultdb database instead of creating its own demo database. #26287
  • cockroach sql and cockroach demo now accept --set to run \set commands prior to starting the shell or running commands via -e. #26287

Admin UI changes

  • Authentication in the Admin UI can now be enabled for secure clusters by setting the environment variable COCKROACH_EXPERIMENTAL_REQUIRE_WEB_LOGIN=TRUE. #25005
  • System databases are now listed after all user databases on the Databases page. #25817
  • Added Statements and Statement Details pages showing fingerprints of incoming statements and basic statistics about them. #24485
  • Lease transfers are now shown in the Range Operations graph on the Replication dashboard. #26653
  • Add a debug page showing how table data is distributed across nodes, as well as the zone configs which are affecting that distribution. #24855

Bug fixes

  • Fixed an issue where the Table details page in the Admin UI would become unresponsive after some time. #26636
  • Fix a bug where cockroach quit would erroneously fail even though the node already successfully shut down. #26158
  • UPSERT is now properly able to write NULL values to every column in tables containing more than one column family. #26169
  • Fixed a bug causing index creation to fail under rare circumstances. #26265
  • Corrected NULL handling during IMPORT of MYSQLOUTFILE. #26275
  • Fixed concurrent access to the same file when using encryption. #26377
  • Fixed a bug where a prepared query would not produce the right value for current_date() if prepared on one day and executed on the next. #26370
  • Rows larger than 8192 bytes are now supported by the "copy from" protocol. #26345
  • Trying to "copy from stdin" into a table that doesn't exist no longer drops the connection. #26345
  • CockroachDB now produces a clearer message when special functions (e.g., generate_series()) are used in an invalid context (e.g., LIMIT). #26425
  • Fixed a rare crash on node decommissioning. #26706
  • Commands are now abandoned earlier once a deadline has been reached. #26643
  • Using SHOW TRACE FOR SESSION multiple times without an intervening SET tracing statement now properly outputs the trace without introducing extraneous duplicate rows. #26746
  • The output of debug and tracing commands is no longer corrupted when byte array values contain invalid UTF-8 sequences. #26769
  • Joins across two interleaved tables no longer return incorrect results under certain circumstances when the equality columns aren't all part of the interleaved columns. #26756
  • Prepared statements using RETURNING NOTHING that are executed using the EXECUTE statement are now properly parallelized. #26668
  • The pretty-print code for SHOW now properly quotes the variable name, and the pretty-printing code for an index definition inside CREATE TABLE now properly indicates whether the index was inverted. #26923
  • Within a transaction, DML statements are now allowed after a TRUNCATE. #26051

Performance improvements

  • Improved the throughput of highly contended writes with the new contentionQueue. #25014
  • The performance impact of dropping a large table has been substantially reduced. #26449
  • Using tuples in a query no longer reverts you to single node local SQL execution. #25860
  • CockroachDB's internal monitoring time series are now encoded using a more efficient on-disk format to provide considerable space savings. Monitoring data written in the old format will not be converted but will still be queryable. #26614
  • Improved the performance of the sortChunks processor. #26874

Build Changes

  • Release binaries are now built with runtime AES detection. #26649

Doc updates


This release includes 328 merged PRs by 35 authors. We would like to thank the following contributors from the CockroachDB community, with special thanks to first-time contributors Chris Seto and Emmanuel.

  • Chris Seto
  • Emmanuel
  • neeral
YesYes NoNo