diff --git a/src/current/_includes/releases/v22.2/v22.2.0-alpha.1.md b/src/current/_includes/releases/v22.2/v22.2.0-alpha.1.md deleted file mode 100644 index a2cd7f67b17..00000000000 --- a/src/current/_includes/releases/v22.2/v22.2.0-alpha.1.md +++ /dev/null @@ -1,890 +0,0 @@ -## v22.2.0-alpha.1 - -Release Date: August 30, 2022 - -{% include releases/release-downloads-docker-image.md release=include.release %} - -

Backward-incompatible changes

- -{% include v22.2/backward-incompatible/alpha.1.md %} - -

Security updates

- -- [HBA configuration](https://www.cockroachlabs.com/docs/v22.2/security-reference/authentication#hba-configuration-syntax) can now restrict admin logins originating from `localhost`. This allows security conscious users to better restrict access to their instance. To restrict admins from logging in to `localhost` insert the following as the first line of your HBA configuration: `host all root 127.0.0.1/32 cert-password`. [#77955][#77955] -- Certain less-secure TLS 1.2 cipher suites are no longer supported. Clients more than five years old may fail to connect. CockroachDB now matches the "recommended" cipher list of the IETF defined in [RFC 8447](https://datatracker.ietf.org/doc/html/rfc8447). [#82362][#82362] -- Changed access requirements to some observability features. Databases/tables/schema endpoints for admin UI require `admin` or `VIEWACTIVITY`. `EXPERIMENTAL_AUDIT` requires `admin` or `MODIFYCLUSTERSETTING`. SQL login requires that the `NOSQLLOGIN` or equivalent role are not set. [#85769][#85769] -- HTTP API endpoints under the `/api/v2/` prefix now allow requests through when the cluster is running in insecure mode. When the cluster is running in insecure mode requests to these endpoints will have the username set to `root`. [#86417][#86417] -- [SCRAM](https://www.cockroachlabs.com/docs/v22.2/security-reference/scram-authentication) is now the default password authentication method. Existing users with passwords will be automatically upgraded to use SCRAM when they next authenticate to the cluster. [#74301][#74301] - -

General changes

- -- When using Azure Cloud Storage for data operations, CockroachDB now calculates the storage account URL from the provided `AZURE_ENVIRONMENT` query parameter. This defaults to `AzurePublicCloud` if not specified, to maintain backward compatibility. [#80511][#80511] -- CockroachDB now collects schema info if [telemetry logging](https://www.cockroachlabs.com/docs/v22.2/logging#telemetry) is enabled. This schema info is added to the telemetry log by a built-in scheduled job which runs on a weekly basis by default. This recurrence can be changed via the `sql.schema.telemetry.recurrence` cluster setting. The schedule can also be paused via [`PAUSE SCHEDULE`](https://www.cockroachlabs.com/docs/v22.2/pause-schedules) followed by its ID, which can be retrieved by querying `SELECT * FROM [SHOW SCHEDULES] WHERE label = 'sql-schema-telemetry'`. [#84761][#84761] -- [Changefeeds](https://www.cockroachlabs.com/docs/v22.2/create-changefeed) without a specified sink will no longer terminate when schema changes occur. [#85458][#85458] -- [Core changefeeds](https://www.cockroachlabs.com/docs/v22.2/changefeed-for) are now more resilient to transient errors (ex. network blips) by adding checkpointing. Previously, transient errors would result in a Core changefeed stopping and terminating the underlying SQL statement. This would require the user to restart the SQL statement. Furthermore, if the Core changefeed were restarted during an initial scan, the initial scan would start from the beginning. For large initial scans, transient errors are more likely, so restarting from the beginning would likely see more transient errors and restarts, which would not progress the changefeed. Now, a Core changefeed will automatically take frequent checkpoints and retry from the last checkpoint when a transient errors occurs. [#86253][#86253] -- Scheduled backups now ensure that data to be backed up is [protected from garbage collection](https://www.cockroachlabs.com/docs/v22.2/create-schedule-for-backup#protected-timestamps-and-scheduled-backups) until it has been successfully backed up. This active management of protected timestamps means that scheduled backups can run at a cadence independent from the GC TTL of the data. [#79976][#79976] - -

Enterprise edition changes

- -- [Incremental backups](https://www.cockroachlabs.com/docs/v22.2/take-full-and-incremental-backups) with mismatched localities are now blocked. [#79135][#79135] -- Users can now authenticate to AWS by passing in the argument `AUTH=assume` and specifying an `AWS_ROLE_ARN={role-ARN}`. A user with `AssumeRole` can optionally be specified with `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` or left blank to use the [default credentials chain](https://www.cockroachlabs.com/docs/v22.2/security-reference/authentication). [#79968][#79968] -- Introduced the `primary_key_filter` option to restrict the span watched by a [changefeed](https://www.cockroachlabs.com/docs/v22.2/change-data-capture-overview) only to the portion that satisfies the filtering predicate. [#80499][#80499] -- Changefeed restarts and changefeeds started with the [`cursor`](https://www.cockroachlabs.com/docs/v22.2/create-changefeed#cursor-option) option are now more efficient by using the catchup scan progress checkpoint. [#77763][#77763] -- Storage and KMS URIs for Google Cloud Storage in [`BACKUP`](https://www.cockroachlabs.com/docs/v22.2/backup) and [`RESTORE`](https://www.cockroachlabs.com/docs/v22.2/restore) now accept an `ASSUME_ROLE` parameter, which informs the current service account authenticated by either [implicit or specified credentials](https://www.cockroachlabs.com/docs/v22.2/cloud-storage-authentication) to obtain temporary credentials for the service account specified by the `ASSUME_ROLE` parameter in order to access the resource specified by the URI. [#80417][#80417] -- The [`CREATE CHANGEFEED`](https://www.cockroachlabs.com/docs/v22.2/create-changefeed) statement now supports general expressions: predicates and projections. Projections allow users to emit specific columnar data, including computed columns. While predicates (i.e., filters) allow users to restrict the data that emits to only those events that match the filter. For example: `CREATE CHANGEFEED INTO 'kafka://' AS SELECT * FROM t WHERE NOT cdc_is_delete()`. [#82562][#82562] -- Added replanning functionality for [changefeeds](https://www.cockroachlabs.com/docs/v22.2/change-data-capture-overview) when topology changes by adding a new replanning counter metric. This functionality is only supported for CockroachDB {{ site.data.products.serverless }} clusters.. [#83143][#83143] -- Allowed the `ASSUME_ROLE` parameter in [Amazon S3 and Google Cloud Storage KMS URIs](https://www.cockroachlabs.com/docs/v22.2/take-and-restore-encrypted-backups) to specify a list of roles with a comma-separated string. The roles in the list can chain assume to access the resource specified by the URI. [#83712][#83712] -- The URI for [Google Cloud Pub/Sub](https://www.cockroachlabs.com/docs/v22.2/changefeed-sinks#google-cloud-pub-sub) now accepts an `ASSUME_ROLE` parameter, which specifies a comma-separated list of service accounts to chain assume by the service account authenticated by the [implicit or specified credentials](https://www.cockroachlabs.com/docs/v22.2/cloud-storage-authentication). [#84619][#84619] -- Previously, if you dropped a column with the [`schema_change_policy='stop'`](https://www.cockroachlabs.com/docs/v22.2/create-changefeed#schema-policy) option, the changefeed would stop. Dropping a column with a different policy would result in previous rows retransmitting with the dropped column omitted. In some cases, a changefeed may target specific columns (a column family) of a table. In these cases, if a non-target column is dropped, the changefeed should not stop or retransmit values, because the column was not visible to a consumer sink to begin with. With this change, dropping a non-target column from a table will not stop the changefeed when `schema_change_policy` is set to `stop`. With any other policy, dropping a non-target column will not trigger a backfill. [#84674][#84674] -- Implemented functionality to determine the number of [column families](https://www.cockroachlabs.com/docs/v22.2/column-families) that are referenced by a `SELECT` statement in [changefeed](https://www.cockroachlabs.com/docs/v22.2/create-changefeed) expressions and handle appropriately. [#84764][#84764] -- [`BACKUP`](https://www.cockroachlabs.com/docs/v22.2/backup), [`RESTORE`](https://www.cockroachlabs.com/docs/v22.2/restore), and [backup schedule creation](https://www.cockroachlabs.com/docs/v22.2/create-schedule-for-backup) now have corresponding events that emit to the telemetry channel. [#82463][#82463] -- Added the `ALTER BACKUP SCHEDULE` SQL statement to modify existing [backup schedules](https://www.cockroachlabs.com/docs/v22.2/manage-a-backup-schedule). [#85489][#85489] -- [`CREATE CHANGEFEED`](https://www.cockroachlabs.com/docs/v22.2/create-changefeed) statements with `AS SELECT ...` will require the option `schema_change_policy='stop'`. This means that the changefeed will stop if schema changes occur. [#85896][#85896] -- Introduced a new rangefeed RPC called `MuxRangeFeed`. Rangefeeds now use a common HTTP/2 stream per client for all range replicas on a node, instead of one per replica. This significantly reduces the amount of network buffer memory usage, which could cause nodes to run out of memory if a client was slow to consume events. The caller may opt in to use the mechanism by specifying `WITH MuxRangefeed` option when starting the rangefeed. However, a cluster wide `COCKROACH_ENABLE_MULTIPLEXING_RANGEFEED` environment variable may be set to `false` to inhibit the use of this new RPC. [#75581][#75581] -- `ALTER BACKUP SCHEDULE` now supports additional commands like `SET WITH`, `SET SCHEDULE OPTION`, `SET LABEL`, and `SET INTO`. [#86190][#86190] -- [Changefeeds](https://www.cockroachlabs.com/docs/v22.2/change-data-capture-overview) may opt in via `changefeed.mux_rangefeed.enabled` setting to use `MuxRangeFeed` RPC which multiplexes multiple rangefeed streams onto a single RPC stream per node. [#86448][#86448] -- Changefeeds now rate limit log messages related to [resolved timestamps](https://www.cockroachlabs.com/docs/v22.2/create-changefeed#resolved-option). [#82838][#82838] -- Adjusted `per_changefeed_limit` to `128MiB`. The previous default of `1GiB` could pressure garbage collection, which would potentially affect foreground traffic. [#84686][#84686] - -

SQL language changes

- -- Core users that [schedule a backup](https://www.cockroachlabs.com/docs/v22.2/create-schedule-for-backup) without the `FULL BACKUP ALWAYS` clause will receive a warning. [#77506][#77506] -- Implemented the `pg_options_to_table` built-in, which converts an options array format to a table. [#77883][#77883] -- [`COMMENT ON SCHEMA`](https://www.cockroachlabs.com/docs/v22.2/comment-on) can now use qualified schema names. For example, `COMMENT ON SCHEMA sc_name ...` and `COMMENT ON SCHEMA db_name.sc_name ...`. [#79055][#79055] -- Added the `OVERLAPS` syntax and `overlaps()` built-in function. The semantics is the same as the [`OVERLAPS` syntax in PostgreSQL](https://www.postgresql.org/docs/14/functions-datetime.html). This expression yields `true` when two time periods (defined by their endpoints) overlap, `false` when they do not overlap. The endpoints can be specified as pairs of dates, times, or time stamps; or as a date, time, or timestamp followed by an interval. When a pair of values is provided, either the start or the end can be written first. `OVERLAPS` automatically takes the earlier value of the pair as the start. Each time period is considered to represent the half-open interval `start <= time < end`, unless `start` and `end` are equal in which case it represents that single time instant. This means for instance that two time periods with only an endpoint in common do not overlap. [#77015][#77015] -- Direction is now explicit for inverted indices in [`SHOW CREATE TABLE`](https://www.cockroachlabs.com/docs/v22.2/show-create) output. [#78549][#78549] -- Previously, the delimiters for PostgreSQL [`geography` and `geometry`](https://www.cockroachlabs.com/docs/v22.2/spatial-glossary#data-types) was inconsistent. It has been updated to use the `:` delimiter. [#82304][#82304] -- [`ALTER PRIMARY KEY`](https://www.cockroachlabs.com/docs/v22.2/alter-table#alter-primary-key) will no longer create a secondary index on the previous PK columns if they're a strict prefix of an existing secondary index. [#78046][#78046] -- The `to_regclass`, `to_regnamespace`, `to_regproc`, `to_regprocedure`, `to_regrole`, and `to_regtype` [built-in functions](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators) are now supported, improving compatibility with PostgreSQL. [#78652][#78652] -- [Changefeed](https://www.cockroachlabs.com/docs/v22.2/create-changefeed) statements now detect duplicate targets and throw an error. [#79465][#79465] -- Previously, [`BACKUP`](https://www.cockroachlabs.com/docs/v22.2/backup) allowed the user to specify a custom subdirectory name for their backups via `BACKUP .. INTO {subdir} IN {collectionURI}`. This is no longer supported. Users can only create a full backup via `BACKUP ... INTO {collectionURI}` or an incremental backup on the latest full backup in their collection via `BACKUP ... INTO LATEST IN {collectionURI}`. This deprecation also removes the need to address a bug in `SHOW BACKUPS IN`, which cannot display user-defined subdirectories. [#79447][#79447] -- Added a [session variable](https://www.cockroachlabs.com/docs/v22.2/set-vars), `enable_multiple_modifications_of_table`, which can be used instead of cluster variable `sql.multiple_modifications_of_table.enabled` to allow statements containing multiple `INSERT ON CONFLICT`, `UPSERT`, `UPDATE`, or `DELETE` subqueries to modify the same table. As with `sql.multiple_modifications_of_table.enabled`, with this session variable enabled there is nothing to prevent the table corruption seen in [issue #70731](https://github.com/cockroachdb/cockroach/issues/70731) from occurring if the same row is modified multiple times by different subqueries of a single statement. We recommend rewriting these statements, but the session variable is provided as an aid if this is not possible. [#79677][#79677] -- Previously, if a column in a table has a comment, [`SHOW CREATE TABLE`](https://www.cockroachlabs.com/docs/v22.2/show-create) would fail after the column type is changed. This is now fixed. [#79998][#79998] -- Added the [built-in functions](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators): `uuid_nil`, `uuid_ns_dns`, `uuid_ns_url`, `uuid_ns_oid`, and `uuid_ns_x500` provided by the `uuid-ossp` extension in PostgresSQL. [#80204][#80204] -- Added the [built-in functions](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators): `uuid_generate_v1`, `uuid_generate_v1mc`, `uuid_generate_v3`, and `uuid_generate_v5`. [#80204][#80204] -- The command `CREATE EXTENSION "uuid-ossp"` no longer fails, since CockroachDB now includes all the [built-in functions](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators) from this extension. [#80204][#80204] -- Users can now pass [locality-aware backup](https://www.cockroachlabs.com/docs/v22.2/take-and-restore-locality-aware-backups) URIs to [`SHOW BACKUP`](https://www.cockroachlabs.com/docs/v22.2/show-backup). This change only affects `SHOW BACKUP` with the new syntax: e.g., `SHOW BACKUP FROM LATEST IN ({collectionURI}, {localityURI1}, {localityURI2})`. Users cannot run `SHOW BACKUP` for locality-aware backups created using the `incremental_location` parameter. [#79121][#79121] -- Table scans performed as a part of index [joins](https://www.cockroachlabs.com/docs/v22.2/joins), lookup joins, inverted joins, and zigzag joins now respect the row-level locking strength and wait policy specified by the optional `FOR SHARE/UPDATE NOWAIT` clause on `SELECT` statements. [#60719][#60719] -- The `pg_cast` table was populated in order to match PostgreSQL behavior. [#79537][#79537] -- Constraints that only include hidden columns are no longer excluded in [`SHOW CONSTRAINTS`](https://www.cockroachlabs.com/docs/v22.2/show-constraints). You can enable the previous behavior using the `show_primary_key_constraint_on_hidden_columns` session variable. [#80154][#80154] -- Introduced the `ST_XMin`, `ST_XMax`, `STYMin`, and `ST_YMax` geospatial [built-ins](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators). [#80363][#80363] -- Introduced the `st_makeenvelope` [built-in](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators). [#80408][#80408] -- Added the `pgcrypto` `gen_salt` [built-in](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators) with support for the `des`, `xdes`, `md5`, `bf` algorithms. [#80318][#80318] -- Added a new `check_files` option to [`SHOW BACKUP`](https://www.cockroachlabs.com/docs/v22.2/show-backup). This option checks that all SST files and metadata in a backup chain are in their expected location in external storage. If `SHOW BACKUP` cannot read from a file, an error message with the problematic file path returns. A successful `SHOW BACKUP` with `check_files` will also return the additional `file_bytes` column that indicates the estimated bytes on external storage storing a table object in the backup, analogous to the return pattern of the `rows` and `size_bytes` columns. [#80491][#80491] -- Previously, when a [hash-sharded index](https://www.cockroachlabs.com/docs/v22.2/hash-sharded-indexes) was dropped, the accompanying shard column would also drop if no other index used this shard column. For hash-sharded indexes created in v21.2 and earlier, this shard column is a physical, `STORED` column. Dropping such a physical column can be very expensive since it requires a full table rewrite. For hash-sharded indexes created in v22.1 and later, this shard column is a virtual computed column. Dropping a virtual column is not as costly. Now, if the to-be-dropped sharded index has a physical shard column (and no other index uses that column), CockroachDB will drop only the index if not `CASCADE`, or will drop both the index and the column if `CASCADE`. [#80806][#80806] -- Allowed wildcards to [`SHOW GRANTS`](https://www.cockroachlabs.com/docs/v22.2/show-grants) for all schemas in a database. [#80861][#80861] -- Added the `pgcrypt` `crypt` [built-in](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators) with support for the `md5` and `bf` algorithms. [#80809][#80809] -- Added a notice to the `SET CLUSTER SETTINGS sql.defaults...` statement that recommends using the `ALTER ROLE` syntax instead: the [`ALTER ROLE`](https://www.cockroachlabs.com/docs/v22.2/alter-role) syntax allows users to set default values for session variables making `SET CLUSTER SETTINGS sql.defaults...` redundant.. [#80548][#80548] -- The [`JSON`](https://www.cockroachlabs.com/docs/v22.2/jsonb) `?` string operator is now index accelerated if there is an inverted index over the `JSON` column referred to on the left-hand side of the expression and a constant on the right. [#81253][#81253] -- The `?&` and `?|` operators are now index accelerated if the left-hand side is an inverted indexed `JSON` column and the right-hand side is a constant. [#81253][#81253] -- Added a new `RESTART` option to [`ALTER SEQUENCE`](https://www.cockroachlabs.com/docs/v22.2/alter-sequence) and [`CREATE SEQUENCE`](https://www.cockroachlabs.com/docs/v22.2/create-sequence) that sets the `nextval()` to the given number, or back to the original `START` value. This implements the `ALTER SEQUENCE` [PostgreSQL behavior](https://www.postgresql.org/docs/current/sql-altersequence.html). This is similar to calling the `setval()` function with `is_called = false`. That is, the specified value will return by the next call of `nextval()`. Writing `RESTART` with no restart value is equivalent to supplying the start value that was recorded by `CREATE SEQUENCE` or last set by `ALTER SEQUENCE START WITH`. In contrast to a `setval()` call, a `RESTART` operation on a sequence is transactional and blocks concurrent transactions from obtaining numbers from the same sequence. If this is not the desired mode of operation, `setval()` should be used. [#81377][#81377] -- Added syntax support for `{GRANT|REVOKE} ... ON {SEQUENCE | ALL SEQUENCES IN SCHEMA}`. [#79862][#79862] -- [`SHOW EXPERIMENTAL_FINGERPRINTS`](https://www.cockroachlabs.com/docs/v22.2/cockroachdb-feature-availability#show-table-fingerprints) now supports tables with expression indexes. [#81042][#81042] -- Expanded the capabilities of the [`EXPERIMENTAL SCRUB`](https://www.cockroachlabs.com/docs/v22.2/cockroachdb-feature-availability#check-for-constraint-violations-with-scrub) statement to include checking unique constraints for primary keys, unique indexes, and unique columns without indexes. The usage and output of `SCRUB` is unchanged, but if there is a unique constraint violation, users will see the error message `unique_constraint_violation` for all rows that violate the constraint, along with information about the row. [#78297][#78297] -- Added the `pg_trgm.similarity_threshold` session setting that controls the threshold at which the trigram similarity operator `%` returns `true` versus `false`. [#81418][#81418] -- Added support for the `pg_trgm` built-ins `show_trgm`, for showing the trigrams in a string and a measure of how similar two strings are based on their trigrams. [#81418][#81418] -- Added the `%` string trigram similarity overload. [#81418][#81418] -- The `extra_float_digits` [session variable](https://www.cockroachlabs.com/docs/v22.2/set-vars) now defaults to `1`. The meaning of the variable has also changed. Now, any value greater than `0` causes floats to be formatted in their shortest precise decimal representation. That is, the string representation produced is closer to the actual binary value than to any other value. (Previously, this was only the behavior when `extra_float_digits` was set to `3`.) This change was made in accordance with an equivalent change that was part of the PostgreSQL 12.0 release. The behavior of a non-positive `extra_float_digits` value is unchanged: such a value will still reduce the number of float digits shown in the output string. The formula to compute the number of digits shown is `max(1, (DIGITS + extra_float_digits))`, where `DIGITS=6` for `FLOAT4` values, and `DIGITS=15` for `FLOAT8` values. [#82022][#82022] -- Added a new `full_scan` column to the [`crdb_internal.{cluster,node}_queries`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal) table, which describes whether a query contains a full table or index scan. This column is included in the [`SHOW QUERIES`](https://www.cockroachlabs.com/docs/v22.2/show-statements) command. Note that this information is only valid when the query is in the `executing` phase. The `ListSessions` API includes this information under the field `is_full_scan` in the active query for a session. [#81531][#81531] -- `STRING` columns now support inverted indexes using trigrams. These indexes can be searched using the `=`, `LIKE`, `ILIKE`, and `%` (similarity) predicates. [#79705][#79705] -- Permitted usage of `jsonb_ops`, `array_ops`, `gin_trgm_ops`, and `gist_trgm_ops` as an operator class in inverted index creation. [#79705][#79705] -- Casting from an `INT` to `OID`, or calling the `oid` [built-in function](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators), and using an integer that is larger than `32` bits now results in an error. Specifically, the range for valid inputs for these uses is `[MinInt32, MaxUint32]`. [#82430][#82430] -- [`SHOW BACKUP`](https://www.cockroachlabs.com/docs/v22.2/show-backup) WITH `check_files` will display up to 10 missing SST files. [#82274][#82274] -- Index recommendations are now supported for [spatial indexes](https://www.cockroachlabs.com/docs/v22.2/spatial-indexes). [#82293][#82293] -- Added the `to_timestamp` function that converts Unix epoch of `FLOAT`, `INT`, `DECIMAL`, and `TEXT` to `TIMESTAMPTZ`. [#82523][#82523] -- A column's `DEFAULT/ON UPDATE` clause can now have a type that differs from the column type, as long as that type can be assignment-cast into the column's type. This change increases compatibility with PostgreSQL. [#81071][#81071] -- [`COPY ... FROM CSV HEADER`](https://www.cockroachlabs.com/docs/v22.2/copy-from) is now supported. [#82457][#82457] -- Added `rowCount` to TTL job progress. [#81917][#81917] -- Added logic for `GRANT ... ON` sequence names. [#82458][#82458] -- Introduced [system-level privileges](https://www.cockroachlabs.com/docs/v22.2/security-reference/authorization#supported-privileges), which apply cluster-wide. Example: `GRANT SYSTEM MODIFYCLUSTERSETTING TO foo`. Currently `MODIFYCLUSTERSETTING` is the only system-level privilege, it allows users to query the [`crdb_internal.cluster_settings`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal) table. [#82166][#82166] -- Added a `cluster.preserve-downgrade-option.last-updated` metric that reports the Unix timestamp of the last updated time of the `cluster.preserve_downgrade_option` setting. This metric is now also emitted to Prometheus, and used to display a banner to the DB Console if `cluster.preserve_downgrade_option` has been set for greater than 48 hours. This change provides increased observability into upgrade finalization. [#82633][#82633] -- Added support for `DROP OWNED BY`. [#82936][#82936] -- Created two invariants for the `stream_ingestion_stats` built-in, for protobuf and JSON respectively, and extended them to return more details. [#83066][#83066] -- Added support for `JSONB` subscripting in `SELECT`-style cases, e.g., `SELECT json_field['a'] ... WHERE json_field['b'] = ...`. [#82877][#82877] -- Added a new execution statistic that tracks the number of gRPC calls issued to perform read operations to the output of [`EXPLAIN ANALYZE`](https://www.cockroachlabs.com/docs/v22.2/explain-analyze), which exposes low-level details that might aid with debugging the performance of queries. [#83365][#83365] -- Added a new `ttl_expiration_expression` expression for [`CREATE TABLE`](https://www.cockroachlabs.com/docs/v22.2/create-table) and [`ALTER TABLE`](https://www.cockroachlabs.com/docs/v22.2/alter-table). `ttl_expiration_expression` accepts an expression that returns a `TIMESTAMP` to support custom TTL calculation. The following are supported: - - `CREATE TABLE ... WITH (ttl_expiration_expression='...')` - - `ALTER TABLE ... SET (ttl_expiration_expression='...')` - - `ALTER TABLE ... RESET (ttl_expiration_expression)` [#82686][#82686] -- Added a new column, `locality` to the `system.sql_instances` table, which stores the [locality](https://www.cockroachlabs.com/docs/v22.2/cockroach-start#locality) of a SQL instance if it was provided when the instance was started. This exposes a SQL instance's locality to other instances in the cluster for query planning. [#82915][#82915] -- Implemented `DROP INDEX` under the [declarative schema changer](https://www.cockroachlabs.com/docs/v22.2/online-schema-changes#declarative-schema-changer). [#80133][#80133] -- Renamed `oldest_query_start` in the [`crdb_internal.cluster_sessions`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal) and [`crdb_internal.node_sessions`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal) tables to `active_query_start`, as this column contains the time at which the currently active query was started, not the time at which the session's first query was started. [#83451][#83451] -- The [`CREATE CHANGEFEED AS`](https://www.cockroachlabs.com/docs/v22.2/create-changefeed) statement no longer requires `WITH DIFF` when using `cdc_prev()`. [#83717][#83717] -- CockroachDB can now parse the `CREATE FUNCTION` statement, but an unimplemented error will return since the statement is not fully implemented. [#83891][#83891] -- `DROP` statements performed by the [declarative schema changer](https://www.cockroachlabs.com/docs/v22.2/online-schema-changes#declarative-schema-changer) (which is the case by default) now transition descriptor states to `OFFLINE` in the initial schema change transaction before transitioning them to `DROP` in a subsequent transaction executed by the schema change job. [Changefeeds](https://www.cockroachlabs.com/docs/v22.2/change-data-capture-overview) watching tables that are dropped will now reflect this descriptor state in the returned error (i.e., either dropped or taken offline). Additionally, a concurrent [backup](https://www.cockroachlabs.com/docs/v22.2/backup) will see the table as `OFFLINE` before it reaches `DROP`. potentially causing the offline table to be included in the backed-up data. [#83915][#83915] -- Extended the [`CREATE MATERIALIZED VIEW`](https://www.cockroachlabs.com/docs/v22.2/views#materialized-views) statement to support the `WITH NO DATA` clause, which allows the creation of materialized views with no data. Such views require a refresh at least once prior to access. [#83347][#83347] -- Added the `sql.metrics.statement_details.index_recommendation_collection.enabled` [cluster setting](https://www.cockroachlabs.com/docs/v22.2/cluster-settings) that can be disabled if index recommendation generation is causing performance issues. [#84282][#84282] -- Added sequence option info for identity columns under `information_schema`. [#84034][#84034] -- The `inet` [function](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators) has been added to support the conversion of a supplied type to that of the `INET` type family. If the conversion fails, a SQL error will be output. [#83668][#83668] -- The last column of an `INVERTED INDEX` can no longer have the `DESC` option. If `DESC` was used in prior versions, it could cause internal errors. [#84516][#84516] -- Introduced `CREATE EXTERNAL CONNECTION` syntax that can create an external connection representing a resource that resides outside of CockroachDB. The only supported resource at the moment is a `nodelocal` URI that can be represented as an external connection object using: `CREATE EXTERNAL CONNECTION foo AS 'nodelocal://1/foo'`. [#84310][#84310] -- Added [`DROP EXTERNAL CONNECTION`](https://www.cockroachlabs.com/docs/v22.2/drop-external-connection) to drop a previously created external connection object. [#84751][#84751] -- Cluster [`BACKUP`](https://www.cockroachlabs.com/docs/v22.2/backup) and [`RESTORE`](https://www.cockroachlabs.com/docs/v22.2/restore) no longer includes job records, which previously were usually only restored in a canceling state with the exception of schema changes, which restored to their initial running state. Instead, any schema change jobs required for restored tables are recreated after restoring the tables. [#84886][#84886] -- Introduced an `EXTERNALCONNECTION` [system-level privilege](https://www.cockroachlabs.com/docs/v22.2/security-reference/authorization#supported-privileges) that is required to create an external connection object to represent an underlying resource. [#85007][#85007] -- Added a new `is_visible` column to the [`crdb_internal.table_indexes`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal) and `information_schema.statistics` tables. Also, added a new `visible` column to the output of [`SHOW INDEX`](https://www.cockroachlabs.com/docs/v22.2/show-index), `SHOW INDEXES`, and `SHOW KEYS`. The `is_visible` or `visible` columns indicates whether the index is visible to the optimizer. [#84776][#84776] -- Bulk operations and [changefeeds](https://www.cockroachlabs.com/docs/v22.2/create-changefeed) will accept an `external` scheme URI that points to a previously created external connection object. These operations can then interact with the underlying resource represented by the object as they did before. [#84931][#84931] -- Introduced `VIEWACTIVITY`, `VIEWACTIVITYREDACTED`, `VIEWCLUSTERSETTING`, `CANCELQUERY`, and `NOSQLLOGIN` as system privileges. [#84198][#84198] -- The [`SHOW DEFAULT PRIVILEGES`](https://www.cockroachlabs.com/docs/v22.2/show-default-privileges) command now has a column that indicates if the default privilege will give the `GRANT` option to the grantee. [#85027][#85027] -- Previously, [`ALTER DEFAULT PRIVILEGES`](https://www.cockroachlabs.com/docs/v22.2/alter-default-privileges) would error out on functions. Now, the `ALTER DEFAULT PRIVILEGES` statement performs the `GRANT`/`REVOKE` with the newly added `EXECUTE` privilege from default privileges. [#84471][#84471] -- Added the explicit `"true"` and `"false"` values for [`detached`](https://www.cockroachlabs.com/docs/v22.2/backup#detached) and [`revision_history`](https://www.cockroachlabs.com/docs/v22.2/backup#with-revision-history) arguments in `BACKUP` and `CREATE SCHEDULE FOR BACKUP`. [#85146][#85146] -- CockroachDB now supports secondary regions. Secondary regions makes it possible to specify a failover region, which will receive the leaseholder if the primary region fails. [#84450][#84450] -- The parser now supports creating an index marked as invisible. However, this is not fully implemented and executing it returns an `unimplemented` error immediately. [#84783][#84783] -- Renamed `statement` to `stmt` and `transaction` to `txn` in columns in the [`crdb_internal.node_execution_insights`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal) table. Added `txn_fingerprint_id`, `query`, `status`, `start_time`, `end_time`, `full_scan`, `user_name`, `app_name`, `database_name`, `plan_gist`, `rows_read`, `rows_written`, `priority`, and `retries` columns. [#85131][#85131] -- The [`CREATE VIEW`](https://www.cockroachlabs.com/docs/v22.2/create-view) statement can now have a constant `NULL` column definition. The resulting column is of type `TEXT`. [#85134][#85134] -- A Google Cloud Storage KMS can be represented as an [external connection](https://www.cockroachlabs.com/docs/v22.2/create-external-connection) object, which can be used during [`BACKUP`](https://www.cockroachlabs.com/docs/v22.2/backup) or [`RESTORE`](https://www.cockroachlabs.com/docs/v22.2/restore) using the `external` URI. [#85075][#85075] -- The [`IMPORT INTO`](https://www.cockroachlabs.com/docs/v22.2/import-into) statement now supports importing from `CSV`, `AVRO`, and delimited formats into a table with partial indexes. This was previously disallowed. [#85244][#85244] -- Introduced a new [`crdb_internal`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal) virtual table, `cluster_execution_insights`, offering a cluster-wide view of the same node-local information available in `node_execution_insights`. Currently, the insights subsystem is still under development and disabled by default. [#85339][#85339] -- Changed [`EXPLAIN`](https://www.cockroachlabs.com/docs/v22.2/explain) output of full scans with soft limits to `FULL SCAN (SOFT LIMIT)` instead of `FULL SCAN`, to distinguish them from unlimited full scans. Unlimited full scans always scan the entire index. Full scans with soft limits could scan the entire index, but usually halt early once enough rows have been found to satisfy their parent operator. [#85421][#85421] -- Added support for privileges on virtual tables. Previously users were unable to `GRANT` on virtual tables, including [`crdb_internal`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal), `pg_catalog`, and `information_schema`. Now users can `GRANT/REVOKE` `SELECT` privilege on virtual tables. `SELECT` is needed to query a virtual table. Note that virtual table privileges are **not** per database. Executing `GRANT SELECT ON crdb_internal.tables TO foo` allows `foo` to select on `crdb_internal.tables` across all databases. Though executing `GRANT SELECT ON dbname.crdb_internal.tables TO foo` completes without error, the database is ignored. [#83604][#83604] -- Added the `crdb_internal.request_statement_bundle` [built-in](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators), which allows the statement bundle to be requested from the SQL CLI. The new built-in takes three parameters: statement fingerprint text, minimum execution latency for the statement, and the duration the statement bundle request will stay valid for. The `VIEWACTIVITY` or `admin` role option is required to use this built-in. A user with the `VIEWACTIVITYREDACTED` role option is not allowed to use this built-in. [#79693][#79693] -- Added the column `index_recommendations` to [`crdb_internal.node_statement_statistics`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal), `crdb_internal.cluster_statement_statistics`, `system.statement_statistics`, and `crdb_internal.statement_statistics`. [#84618][#84618] -- The `pg_proc.proisstrict` column is now correctly populated instead of always being `false`. If this column is `true`, it indicates that the function will not be called if any of its inputs are `NULL`. Instead, it will directly evaluate to `NULL`. [#85676][#85676] -- When statistics are refreshed for a table, CockroachDB now deletes any existing statistics on that table from columns or sets of columns that do not have their statistics refreshed by default. This ensures that stale statistics are removed and do not impact the ability of the [optimizer](https://www.cockroachlabs.com/docs/v22.2/cost-based-optimizer) to create a high quality query plan. The retention time for these statistics is controlled by a new [cluster setting](https://www.cockroachlabs.com/docs/v22.2/cluster-settings), `sql.stats.non_default_columns.min_retention_period`, which defaults to 24 hours. [#85586][#85586] -- Introduced the `ALTER DATABASE database_name ALTER LOCALITY {GLOBAL|REGIONAL|REGIONAL IN} set_zone_config` syntax, which allows setting the zone config extension. [#83605][#83605] -- Added `last_retry_reason` and `exec_node_ids` columns to the [`crdb_internal.node_execution_insights`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal) table. [#85634][#85634] -- The [`EXPLAIN`](https://www.cockroachlabs.com/docs/v22.2/explain) output no longer annotates simple operations (like `render` and `project`) with the execution statistics or estimates since that information is redundant (it is copied from the child operations). [#85649][#85649] -- Users can now `GRANT USAGE ON EXTERNAL CONNECTION` and `REVOKE USAGE ON EXTERNAL CONNECTION` to grant and revoke the `USAGE` privilege. This privilege is required by all operations that interact with external connections. [#85556][#85556] -- Previously, the `pg_proc` table was only populated with [built-in functions](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators). With the added support for user-defined functions creation, the `pg_proc` table has now been extended to include user-defined function data as well. [#85656][#85656] -- Added a new `SHOW CREATE FUNCTION` statement, taking a function name as an argument. If the given function name is qualified, the explicit schema will be searched. If the function name is not qualified, the schemas on the search path are searched and functions from the most significant schema are returned. [#85656][#85656] -- Previously, `::regproc` casting only supported [built-in functions](https://www.cockroachlabs.com/docs/v22.2/functions-and-operators). Now it is extended to support user-defined functions as well. [#85656][#85656] -- Added a new virtual table [`crdb_internal.create_function_statements`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal) which can be used to query `CREATE` statements of user-defined functions, as well as parent db and schema ids. [#85656][#85656] -- Added the `schema_only` option to [`RESTORE`](https://www.cockroachlabs.com/docs/v22.2/restore), which enables you to run a regular restore without restoring any user table data. This can be used to quickly validate that a given backup is restorable. A `schema_only` restore takes a fraction of a regular restore's runtime. Note that during a cluster level, `schema_only` restore, the system tables are read from storage and written to disk, as this provides important validation coverage without much runtime cost (system tables should not be large). After running a successful `schema_only` restore, you can revert the cluster to its pre-restore state by dropping the descriptors added by the `schema_only` restore (e.g., if you restored a database, you can drop the database after the restore completes). [#85231][#85231] -- Added the `VIEWDEBUG` and `VIEWCLUSTERMETADATA` system privileges. [#85280][#85280] -- Added new index recommendations that are generated every hour and available from `system.statement_statistics` and [`crdb_internal.statement_statistics`](https://www.cockroachlabs.com/docs/v22.2/crdb-internal). Added a new `sql.metrics.statement_details.max_mem_reported_idx_recommendations` [cluster setting](https://www.cockroachlabs.com/docs/v22.2/cluster-settings) with a default value of `100k`. [#85343][#85343] -- `SELECT ... FOR {UPDATE,SHARE} SKIP LOCKED` is now supported. The option can be used to skip rows that cannot be immediately locked instead of blocking on contended row-level lock acquisition. [#85720][#85720] -- Implemented `DROP FUNCTION` in the legacy schema changer. Now users can drop a function with a function name or a function signature. [#85718][#85718] -- Users can now `GRANT DROP ON EXTERNAL CONNECTION` and `REVOKE DROP ON EXTERNAL CONNECTION` to grant and revoke the `DROP` privilege. This privilege is required by the user to `DROP` a particular external connection. [#85770][#85770] -- The `CREATE EXTERNAL CONNECTION` statement can be now used to represent a [`kafka` sink](https://www.cockroachlabs.com/docs/v22.2/changefeed-sinks#kafka). Subsequently, users can run [`CREATE CHANGEFEED`](https://www.cockroachlabs.com/docs/v22.2/create-changefeed) with an `external:///