--- title: What's New in v20.2.0 toc: true summary: Additions and changes in CockroachDB version v20.2.0. --- ## November 10, 2020 With the release of CockroachDB v20.2, we've made a variety of productivity, management, and performance improvements. Check out a [summary of the most significant user-facing changes](#feature-summary) and then [upgrade to CockroachDB v20.2](../v20.2/upgrade-cockroach-version.html). To learn more: - Read the [v20.2 blog post](https://www.cockroachlabs.com/blog/cockroachdb-20-2-release/) - Join a v20.2 overview and live demo session on Thursday, December 3rd: - [North America session](https://www.cockroachlabs.com/webinars/20.2-na): 1pm EST / 10am PST - [EMEA session](https://www.cockroachlabs.com/webinars/20.2-emea): 1pm CEST ## Downloads
## Docker image {% include copy-clipboard.html %} ~~~ shell $ docker pull cockroachdb/cockroach:v20.2.0 ~~~ ## CockroachCloud [Get a free v20.2 cluster on CockroachCloud](https://cockroachlabs.cloud/signup) Recent CockroachCloud improvements: - [Create a 30-day free CockroachCloud cluster](../cockroachcloud/quickstart.html). - [Add or remove nodes](../cockroachcloud/cluster-management.html#add-or-remove-nodes-from-a-cluster) through the CockroachCloud Console. - [Set up VPC peering](../cockroachcloud/network-authorization.html) for clusters running on GCP. - [Restore data from a backup](../cockroachcloud/backups-page.html) for clusters running on AWS. ## Feature summary This section summarizes the most significant user-facing changes in v20.2.0. For a complete list of features and changes, including bug fixes and performance improvements, see the [release notes](index.html#testing-releases) for previous testing releases. You can also search for [what's new in v20.2 in our docs](../search.html?query=%22New%20in%20v20.2%22&page=2). {{site.data.alerts.callout_info}} "Core" features are freely available in the core version and do not require an enterprise license. "Enterprise" features require an [enterprise license](https://www.cockroachlabs.com/get-cockroachdb/). [CockroachCloud clusters](https://cockroachlabs.cloud/) include all enterprise features. {{site.data.alerts.end}} - [SQL](#sql) - [Recovery and I/O](#recovery-and-i-o) - [Deployment and Operations](#deployment-and-operations) - [Observability](#observability) - [Backward-incompatible changes](#backward-incompatible-changes) - [Deprecations](#deprecations) - [Known limitations](#known-limitations) - [Education](#education) ### SQL Version | Feature | Description --------|---------|------------ Core | **Third-Party Tool Support** | CockroachDB now fully supports several additional [third-party database tools](../v20.2/third-party-database-tools.html), including Spring Boot, Hibernate, and ActiveRecord. Core | **Spatial Support** | CockroachDB now supports [spatial data types](../v20.2/spatial-data.html), [spatial indexes](../v20.2/spatial-indexes.html), and [spatial functions](../v20.2/functions-and-operators.html#spatial-functions), as well as the ability to migrate spatial data from various formats such as [Shapefiles](../v20.2/migrate-from-shapefiles.html), [GeoJSON](../v20.2/migrate-from-geojson.html), [GeoPackages](../v20.2/migrate-from-geopackage.html), and [OpenStreetMap](../v20.2/migrate-from-openstreetmap.html). Core | **User-Defined Schemas** | You can now [create user-defined logical schemas](../v20.2/create-schema.html), as well [alter user-defined schemas](../v20.2/alter-schema.html), [drop user-defined schemas](../v20.2/drop-schema.html), and [convert databases to user-defined schemas](../v20.2/convert-to-schema.html). Core | **Partial Indexes** | You can now use [partial indexes](../v20.2/partial-indexes.html) to specify a subset of rows and columns in a table that evaluate to true on a `WHERE` filter defined at index creation. Core | **`ENUM` data types** | CockroachDB now supports the creation and management of [user-defined `ENUM` data types](../v20.2/enum.html) consisting of sets of enumerated, static values. Core | **Materialized Views** | CockroachDB now supports [materialized views](../v20.2/views.html#materialized-views), or views that store their selection query results on-disk. Core | **View Replacement** | CockroachDB now supports [replacing an existing view](../v20.2/create-view.html#replace-an-existing-view) with the `CREATE OR REPLACE VIEW` syntax. Core | **Foreign Key Performance and Compatibility** | When adding the [`FOREIGN KEY`](../v20.2/foreign-key.html) constraint, it is no longer required to have an index on the referencing columns. Core | **`EXPLAIN` Improvements** | The response of the [`EXPLAIN`](../v20.2/explain.html) statement now includes the estimated number of rows scanned by the query as well as other usability improvements. Core | **Disallowing Full Table Scans** | You can use the new [`disallow_full_table_scans` session variable](../v20.2/set-vars.html) to disallow full table and secondary index scans. Core | **Altering Column Data Types** | You can now [alter the data type of table column](../v20.2/alter-column.html#altering-column-data-types). Note that this feature is [experimental](../v20.2/experimental-features.html) and is subject to change. ### Recovery and I/O Version | Feature | Description --------|---------|------------ Core | **Backup/Restore in Core Version** | The core version of CockroachDB now lets you perform [full cluster backups](../v20.2/take-full-and-incremental-backups.html#full-backups), all [restore](../v20.2/restore.html) options, as well as bulk [exports](../v20.2/export.html). Incremental backups, locality-aware backups, and other advanced backup functionality continue to require an enterprise license. Core | **Backup Scheduling** | You can now [create schedules for CockroachDB backups](../v20.2/manage-a-backup-schedule.html#create-a-new-backup-schedule), as well as [view, pause, resume, and drop backup schedules](../v20.2/manage-a-backup-schedule.html#view-and-control-the-backup-schedule). Once a scheduled backup is created, you can use [`SHOW SCHEDULE`](../v20.2/show-schedules.html) to inspect the schedule status and any errors and then use [`SHOW BACKUPS IN` and `SHOW BACKUP`](../v20.2/manage-a-backup-schedule.html#view-scheduled-backup-details) to inspect the details of individual backups. Note that incremental backups, locality-aware backups, and other advanced backup functionality require an enterprise license. Core | **Import with User-Scoped Storage** | In addition to supporting bulk imports from cloud storage, CockroachDB now lets you [upload CSV files from your local machine to user-scoped file storage](../v20.2/use-userfile-for-bulk-operations.html) in your cluster. Once uploaded, a userfile can be reference by the `IMPORT` command to import data into a table. Userfiles can also be [listed](../v20.2/cockroach-userfile-list.html) and [deleted](../v20.2/cockroach-userfile-delete.html) via CLI commands. Core | **Import with Default Expressions** | You can now use [`IMPORT INTO`](../v20.2/import-into.html) to import supported [`DEFAULT` expressions](../v20.2/import-into.html#supported-default-expressions) as well as [computed columns](../v20.2/computed-columns.html). Enterprise | **KMS Support for Encrypted Backups** | You can now use [AWS Key Management Service (KMS)](../v20.2/take-and-restore-encrypted-backups.html#use-aws-key-management-service) to encrypt the files that full or incremental backups generate. ### Deployment and Operations Version | Feature | Description --------|---------|------------ Core | **Kubernetes Operator** | The CockroachDB Kubernetes Operator eases [deployment of secure CockroachDB clusters on Kubernetes](../v20.2/orchestrate-cockroachdb-with-kubernetes.html). The Operator can be used to create StatefulSets, authenticate pods, scale CockroachDB clusters, and perform rolling upgrades. Core | **Log Redaction** | When gathering log files via the [`cockroach debug zip`](../v20.2/cockroach-debug-zip.html) or [`cockroach debug merge-logs`](../v20.2/cockroach-debug-merge-logs.html) command, you can use the new `--redact-logs` flag to redact sensitive data. Note that this flag removes sensitive information only from the log files; other items collected by the `debug zip` command may still contain sensitive information. Core | **Certificate Revocation with OCSP** | CockroachDB now supports [certificate revocation](../v20.2/create-security-certificates-custom-ca.html#certificate-revocation-with-ocsp) for custom CA certificate setups running an OCSP server. Enterprise | **SSO in the DB Console** | The DB Console now supports [single sign-on (SSO)](../v20.2/sso.html) via OpenID Connect (OIDC), an authentication layer built on top of OAuth 2.0. When SSO is configured and enabled, the DB Console login page displays an OAuth login button in addition to the password access option. Note that this feature is [experimental](../v20.2/experimental-features.html) and is subject to change. Core | **Permission-Based Object Ownership** | All database objects now have [owners](../v20.2/owner-to.html). By default, the user who created an object is the owner of the object and has all privileges on the object. Any roles that are members of the `owner` role have all privileges on the objects the role owns. The admin is the default owner for all non-system objects without owners. System objects without owners have `node` as their owner. Core | **Fine-Grained SQL Privileges** | CockroachDB now allows you to [grant users administrative abilities](../v20.2/create-role.html#parameters) without giving them full admin access. ### Observability Version | Feature | Description --------|---------|------------ Core | **Transaction Details** | The new [**Transactions** page](../v20.2/ui-transactions-page.html) of the DB Console shows you details about all client-initiated transactions in the cluster that help you identify and troubleshoot frequently retried and high-latency transactions. Core | **Sessions Details** | The new [**Sessions** page](../v20.2/ui-sessions-page.html) of the DB Console shows you details about all active and idle sessions in the cluster, with session age, memory usage, SQL statement, and other details available for active sessions. ### Backward-incompatible changes Before [upgrading to CockroachDB v20.2](../v20.2/upgrade-cockroach-version.html), be sure to review the following backward-incompatible changes and adjust your deployment as necessary. - A CockroachDB node started with [`cockroach start`](../v20.2/cockroach-start.html) without the `--join` flag no longer automatically initializes the cluster. The `cockroach init` command is now mandatory. The auto-initialization behavior had been deprecated in version 19.2. - CockroachDB v20.1 introduced a new rule for the `--join` flag to [`cockroach start`](../v20.2/cockroach-start.html), causing it to prefer SRV records, if present in DNS, to look up the peer nodes to join. This feature is experimental, and has been found to cause disruption in in certain deployments. To reduce this disruption and the resulting UX surprise, the feature is now gated behind a new command-line flag `--experimental-dns-srv` which must now be explicitly passed to [`cockroach start`](../v20.2/cockroach-start.html) to enable it. - The `--socket` flag of [`cockroach start`](../v20.2/cockroach-start.html) was deprecated in v20.1 and has been removed in v20.2. Use `--socket-dir` instead. - The textual error and warning messages displayed by [`cockroach quit`](../v20.2/cockroach-quit.html) under various circumstances have been updated. Meanwhile, the message "`ok`" remains as an indicator that the operation has likely succeeded. - [`cockroach quit`](../v20.2/cockroach-quit.html) now prints out progress details on its standard error stream, even when `--logtostderr` is not specified. Previously, nothing was printed on standard error. Scripts that wish to ignore this output can redirect the stderr stream. - Previously, the phase of server shutdown responsible for range lease transfers to other nodes would give up after 10000 attempts of transferring replica leases away, regardless of the value of `server.shutdown.lease_transfer_wait`. The limit of 10000 attempts has been removed, so that now only the maximum duration `server.shutdown.lease_transfer_wait` applies. - Previously, issuing a `SIGTERM` signal twice or after another signal initiated a hard shutdown for a node. Now the first `SIGTERM` signal initiates a graceful shutdown and further occurrences of `SIGTERM` are ignored. To initiate a hard shutdown, issue `SIGINT` two times (or issue a `SIGINT` signal once after a `SIGTERM` signal). - Clusters running alphas of 20.2 that use `ENUM` types will not be able to upgrade to betas or major releases of 20.2 due to internal representation changes. - Specifying the same option multiple times in the `WITH` clause of the [`BACKUP`](../v20.2/backup.html) or [`RESTORE`](../v20.2/restore.html) statement now results in an error message. Additionally, quoted option names are no longer allowed. - The copy of system and `crdb_internal` tables extracted by [`cockroach debug zip`](../v20.2/cockroach-debug-zip.html) is now written using the TSV format (inside the zip file), instead of an ASCII-art table as previously. - The [`SHOW RANGE FOR ROW`](../v20.2/show-range-for-row.html) statement now takes a tuple of the row's index columns instead of the full column set of the row. - For expression typing involving only operations on constant literals, each constant literal is now assigned a [`type`](../v20.2/data-types.html) before calculation. Previously, a `type` was assigned only to the final result. - The file names for heap profile dumps now use the naming scheme `memprof..`. Previously, they were named `memprof..`. - The Docker image is now based on RedHat's UBI instead of Debian. - `cockroach node decommission --wait=live` is no longer supported. It was deprecated in an earlier release. ### Deprecations - The [`cockroach quit`](../v20.2/cockroach-quit.html) command is now deprecated. For decommissioning, use the [`cockroach node decommission`](../v20.2/cockroach-node.html) command. To terminate the cockroach process, use signals. - The [`cockroach dump`](../v20.2/cockroach-dump.html) command is now deprecated. Instead, back up your data in a [full backup](../v20.2/take-full-and-incremental-backups.html), [export](../v20.2/export.html) your data in plain text format, or view table schema in plaintext with [`SHOW CREATE TABLE`](../v20.2/show-create.html). - The `--log-dir-max-size` command-line flag is now deprecated and has been replaced with a new flag named `--log-group-max-size`. The flags limit the combined size of all files generated by one *logging group* inside CockroachDB. - CockroachDB built-in SQL shell ([`cockroach sql`](../v20.2/cockroach-sql.html) and/or [`cockroach demo`](../v20.2/cockroach-demo.html)) no longer prompts for more lines of input after the user enters `BEGIN` before sending the input to the server. Instead, full lines of input are always sent to the server immediately. The corresponding client-side option `smart_prompt` is thus ineffective and deprecated. It will be removed in a later version. ### Known limitations For information about new and unresolved limitations in CockroachDB v20.2, with suggested workarounds where applicable, see [Known Limitations](../v20.2/known-limitations.html). ### Education Area | Topic | Description -----|-------|------------ Training | **Online Course for Python Developers** | Launched a new self-paced course on Cockroach University, [CockroachDB for Python Developers](https://university.cockroachlabs.com). This course walks you through building a full-stack vehicle-sharing app in Python using the popular SQLAlchemy ORM and a free CockroachCloud cluster as the back-end. Docs | **Interactive In-Browser Tutorials** | Added tutorials that can be completed entirely in your browser, without downloads or installations, from [Learning CockroachDB SQL](../tutorials/learn-cockroachdb-sql-interactive.html) to [Building a Python App on CockroachDB](../tutorials/build-a-python-app-with-cockroachdb-interactive.html) to [Storing and Querying JSON](../tutorials/demo-json-support-interactive.html). Docs | **Transaction Retry Error Reference** | Documented the various [errors that developers encounter around transaction retries](../v20.2/transaction-retry-error-reference.html) in CockroachDB, explaining why each error happens and what to do about it. Docs | **Disaster Recovery** | Documented how to plan for and recover from [various types of disasters](../v20.2/disaster-recovery.html), from hardware failure, to data failure, to compromised security keys. Docs | **Batch Deletes** | Added guidance on [performing large deletes](../v20.2/delete.html#batch-deletes) across various scenarios. Docs | **Multi-Region Kubernetes on EKS** | Added a tutorial on orchestrating a secure [CockroachDB multi-region deployment on Amazon EKS](../v20.2/orchestrate-cockroachdb-with-kubernetes-multi-cluster.html).