From 3053645dcf7d106e037037f857542b20ea8bba2b Mon Sep 17 00:00:00 2001 From: Jesse Seldess Date: Sun, 12 Apr 2020 20:25:57 -0400 Subject: [PATCH] Add new known limitations and remove resolved limitations Fixes #6835. Fixes #6837. --- v19.1/known-limitations.md | 40 ++++++---- v19.2/known-limitations.md | 46 ++++++----- v19.2/migrate-from-oracle.md | 1 - v2.0/known-limitations.md | 25 ++++-- v2.1/known-limitations.md | 30 +++---- v20.1/known-limitations.md | 147 ++++++++++++++++++++++------------- v20.1/migrate-from-oracle.md | 1 - 7 files changed, 183 insertions(+), 107 deletions(-) diff --git a/v19.1/known-limitations.md b/v19.1/known-limitations.md index ed3900f1bb4..1188c21409e 100644 --- a/v19.1/known-limitations.md +++ b/v19.1/known-limitations.md @@ -6,6 +6,16 @@ toc: true This page describes newly identified limitations in the CockroachDB {{page.release_info.version}} release as well as unresolved limitations identified in earlier releases. +## New limitations + +### Enterprise `BACKUP` does not capture database/table/column comments + +The [`COMMENT ON`](comment-on.html) statement associates comments to databases, tables, or columns. However, the internal table (`system.comments`) in which these comments are stored is not captured by enterprise [`BACKUP`](backup.html). + +As a workaround, alongside a `BACKUP`, run the [`cockroach dump`](sql-dump.html) command with `--dump-mode=schema` for each table in the backup. This will emit `COMMENT ON` statements alongside `CREATE` statements. + +[Tracking Github Issue](https://github.com/cockroachdb/cockroach/issues/44396) + ## Unresolved limitations ### Adding stores to a node @@ -169,14 +179,6 @@ This conversion is currently only well defined for a small range of integers, i. [Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/20136) -### Cannot decommission nodes - -The [`cockroach node decommission`](https://www.cockroachlabs.com/docs/stable/view-node-details.html#subcommands) command will hang when used to target a set of nodes that cannot be removed without breaking the configured replication rules. - -Example: decommissioning a node in a three node cluster will not work because ranges would become under-replicated. - -[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/18029) - ### Importing data using the PostgreSQL COPY protocol Currently, the built-in SQL shell provided with CockroachDB (`cockroach sql` / `cockroach demo`) does not support importing data using the `COPY` statement. Users can use the `psql` client command provided with PostgreSQL to load this data into CockroachDB instead. For details, see [Import from generic SQL dump](https://www.cockroachlabs.com/docs/stable/import-data.html#import-from-generic-sql-dump). @@ -224,25 +226,37 @@ Most client drivers and frameworks use the text format to pass placeholder value {% include {{ page.version.version }}/known-limitations/partitioning-with-placeholders.md %} -### Adding a column with certain `DEFAULT` values +### Adding a column with sequence-based `DEFAULT` values -It is currently not possible to [add a column](add-column.html) to a table when the column uses a [sequence](create-sequence.html), [computed column](computed-columns.html), or certain evaluated expressions as the [`DEFAULT`](default-value.html) value, for example: +It is currently not possible to [add a column](add-column.html) to a table when the column uses a [sequence](create-sequence.html) as the [`DEFAULT`](default-value.html) value, for example: {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g INT DEFAULT nextval('initial_seq') +> CREATE TABLE t (x INT); ~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g OID DEFAULT 'foo'::regclass::oid +> INSERT INTO t(x) VALUES (1), (2), (3); ~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g INT DEFAULT 'foo'::regtype::INT +> CREATE SEQUENCE s; ~~~ +{% include copy-clipboard.html %} +~~~ sql +> ALTER TABLE t ADD COLUMN y INT DEFAULT nextval('s'); +~~~ + +~~~ +ERROR: nextval(): unimplemented: cannot evaluate scalar expressions containing sequence operations in this context +SQLSTATE: 0A000 +~~~ + +[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/42508) + ### Available capacity metric in the Admin UI {% include {{ page.version.version }}/misc/available-capacity-metric.md %} diff --git a/v19.2/known-limitations.md b/v19.2/known-limitations.md index f7579750adf..4acd31bed4f 100644 --- a/v19.2/known-limitations.md +++ b/v19.2/known-limitations.md @@ -33,6 +33,14 @@ pq: check constraint violated ## Unresolved limitations +### Enterprise `BACKUP` does not capture database/table/column comments + +The [`COMMENT ON`](comment-on.html) statement associates comments to databases, tables, or columns. However, the internal table (`system.comments`) in which these comments are stored is not captured by enterprise [`BACKUP`](backup.html). + +As a workaround, alongside a `BACKUP`, run the [`cockroach dump`](cockroach-dump.html) command with `--dump-mode=schema` for each table in the backup. This will emit `COMMENT ON` statements alongside `CREATE` statements. + +[Tracking Github Issue](https://github.com/cockroachdb/cockroach/issues/44396) + ### Adding stores to a node {% include {{ page.version.version }}/known-limitations/adding-stores-to-node.md %} @@ -188,14 +196,6 @@ As a workaround, set `default_int_size` via your database driver, or ensure that [Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/32846) -### Cannot decommission nodes - -The [`cockroach node decommission`](https://www.cockroachlabs.com/docs/stable/cockroach-node.html#subcommands) command will hang when used to target a set of nodes that cannot be removed without breaking the configured replication rules. - -Example: decommissioning a node in a three node cluster will not work because ranges would become under-replicated. - -[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/18029) - ### Importing data using the PostgreSQL COPY protocol Currently, the built-in SQL shell provided with CockroachDB (`cockroach sql` / `cockroach demo`) does not support importing data using the `COPY` statement. Users can use the `psql` client command provided with PostgreSQL to load this data into CockroachDB instead. For details, see [Import from generic SQL dump](https://www.cockroachlabs.com/docs/stable/import-data.html#import-from-generic-sql-dump). @@ -228,25 +228,37 @@ Most client drivers and frameworks use the text format to pass placeholder value {% include {{ page.version.version }}/known-limitations/partitioning-with-placeholders.md %} -### Adding a column with certain `DEFAULT` values +### Adding a column with sequence-based `DEFAULT` values -It is currently not possible to [add a column](add-column.html) to a table when the column uses a [sequence](create-sequence.html), [computed column](computed-columns.html), or certain evaluated expressions as the [`DEFAULT`](default-value.html) value, for example: +It is currently not possible to [add a column](add-column.html) to a table when the column uses a [sequence](create-sequence.html) as the [`DEFAULT`](default-value.html) value, for example: + +{% include copy-clipboard.html %} +~~~ sql +> CREATE TABLE t (x INT); +~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g INT DEFAULT nextval('initial_seq') +> INSERT INTO t(x) VALUES (1), (2), (3); ~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g OID DEFAULT 'foo'::regclass::oid +> CREATE SEQUENCE s; ~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g INT DEFAULT 'foo'::regtype::INT +> ALTER TABLE t ADD COLUMN y INT DEFAULT nextval('s'); +~~~ + +~~~ +ERROR: nextval(): unimplemented: cannot evaluate scalar expressions containing sequence operations in this context +SQLSTATE: 0A000 ~~~ +[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/42508) + ### Available capacity metric in the Admin UI {% include {{ page.version.version }}/misc/available-capacity-metric.md %} @@ -269,14 +281,6 @@ When inserting/updating all columns of a table, and the table has no secondary i This issue is particularly relevant when using a simple SQL table of two columns to [simulate direct KV access](sql-faqs.html#can-i-use-cockroachdb-as-a-key-value-store). In this case, be sure to use the `UPSERT` statement. -### Write and update limits for a single statement - -A single statement can perform at most 64MiB of combined updates. When a statement exceeds these limits, its transaction gets aborted. Currently, `INSERT INTO ... SELECT FROM` and `CREATE TABLE AS SELECT` queries may encounter these limits. - -To increase these limits, you can update the [cluster-wide setting](cluster-settings.html) `kv.raft.command.max_size`, but note that increasing this setting can affect the memory utilization of nodes in the cluster. For `INSERT INTO .. SELECT FROM` queries in particular, another workaround is to manually page through the data you want to insert using separate transactions. - -In the v1.1 release, the limit referred to a whole transaction (i.e., the sum of changes done by all statements) and capped both the number and the size of update. In this release, there's only a size limit, and it applies independently to each statement. Note that even though not directly restricted any more, large transactions can have performance implications on the cluster. - ### Using `\|` to perform a large input in the SQL shell In the [built-in SQL shell](cockroach-sql.html), using the [`\|`](cockroach-sql.html#commands) operator to perform a large number of inputs from a file can cause the server to close the connection. This is because `\|` sends the entire file as a single query to the server, which can exceed the upper bound on the size of a packet the server can accept from any client (16MB). diff --git a/v19.2/migrate-from-oracle.md b/v19.2/migrate-from-oracle.md index c1fe4eb5c7f..c609bd25ec2 100644 --- a/v19.2/migrate-from-oracle.md +++ b/v19.2/migrate-from-oracle.md @@ -226,7 +226,6 @@ When moving from Oracle to CockroachDB data types, consider the following: - [Silent validation error with `DECIMAL` values](known-limitations.html#silent-validation-error-with-decimal-values) - [Schema changes within transactions](known-limitations.html#schema-changes-within-transactions) - [Schema changes between executions of prepared statements](online-schema-changes.html#no-schema-changes-between-executions-of-prepared-statements) -- [Write and update limits for a single statement](known-limitations.html#write-and-update-limits-for-a-single-statement) - If [`JSON`](jsonb.html) columns are used only for payload, consider switching to [`BYTES`](bytes.html). - Max size of a single column family (64 MiB by default). diff --git a/v2.0/known-limitations.md b/v2.0/known-limitations.md index cf823cb7204..615fac9aae2 100644 --- a/v2.0/known-limitations.md +++ b/v2.0/known-limitations.md @@ -123,22 +123,37 @@ However, the same statement with `INSERT ... ON CONFLICT` incorrectly succeeds a {% include {{ page.version.version }}/known-limitations/partitioning-with-placeholders.md %} -### Adding a column with certain `DEFAULT` values +### Adding a column with sequence-based `DEFAULT` values -It is currently not possible to [add a column](add-column.html) to a table when the column uses a [sequence](create-sequence.html), [computed column](computed-columns.html), or certain evaluated expressions as the [`DEFAULT`](default-value.html) value, for example: +It is currently not possible to [add a column](add-column.html) to a table when the column uses a [sequence](create-sequence.html) as the [`DEFAULT`](default-value.html) value, for example: +{% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g INT DEFAULT nextval('initial_seq') +> CREATE TABLE t (x INT); ~~~ +{% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g OID DEFAULT 'foo'::regclass::oid +> INSERT INTO t(x) VALUES (1), (2), (3); ~~~ +{% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g INT DEFAULT 'foo'::regtype::INT +> CREATE SEQUENCE s; ~~~ +{% include copy-clipboard.html %} +~~~ sql +> ALTER TABLE t ADD COLUMN y INT DEFAULT nextval('s'); +~~~ + +~~~ +ERROR: nextval(): unimplemented: cannot evaluate scalar expressions containing sequence operations in this context +SQLSTATE: 0A000 +~~~ + +[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/42508) + ## Unresolved Limitations ### Database and table renames are not transactional diff --git a/v2.1/known-limitations.md b/v2.1/known-limitations.md index 49c3ceac2ed..408f0ee64fb 100644 --- a/v2.1/known-limitations.md +++ b/v2.1/known-limitations.md @@ -132,14 +132,6 @@ This conversion is currently only well defined for a small range of integers, i. [Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/20136) -### Cannot decommission nodes - -The [`cockroach node decommission`](https://www.cockroachlabs.com/docs/stable/view-node-details.html#subcommands) command will hang when used to target a set of nodes that cannot be removed without breaking the configured replication rules. - -Example: decommissioning a node in a three node cluster will not work because ranges would become under-replicated. - -[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/18029) - ### Importing data using the PostgreSQL COPY protocol Currently, the built-in SQL shell provided with CockroachDB (`cockroach sql` / `cockroach demo`) does not support importing data using the `COPY` statement. Users can use the `psql` client command provided with PostgreSQL to load this data into CockroachDB instead. For details, see [Import from generic SQL dump](https://www.cockroachlabs.com/docs/stable/import-data.html#import-from-generic-sql-dump). @@ -203,25 +195,37 @@ Most client drivers and frameworks use the text format to pass placeholder value {% include {{ page.version.version }}/known-limitations/partitioning-with-placeholders.md %} -### Adding a column with certain `DEFAULT` values +### Adding a column with sequence-based `DEFAULT` values + +It is currently not possible to [add a column](add-column.html) to a table when the column uses a [sequence](create-sequence.html) as the [`DEFAULT`](default-value.html) value, for example: -It is currently not possible to [add a column](add-column.html) to a table when the column uses a [sequence](create-sequence.html), [computed column](computed-columns.html), or certain evaluated expressions as the [`DEFAULT`](default-value.html) value, for example: +{% include copy-clipboard.html %} +~~~ sql +> CREATE TABLE t (x INT); +~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g INT DEFAULT nextval('initial_seq') +> INSERT INTO t(x) VALUES (1), (2), (3); ~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g OID DEFAULT 'foo'::regclass::oid +> CREATE SEQUENCE s; ~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g INT DEFAULT 'foo'::regtype::INT +> ALTER TABLE t ADD COLUMN y INT DEFAULT nextval('s'); +~~~ + +~~~ +ERROR: nextval(): unimplemented: cannot evaluate scalar expressions containing sequence operations in this context +SQLSTATE: 0A000 ~~~ +[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/42508) + ### Available capacity metric in the Admin UI {% include {{page.version.version}}/misc/available-capacity-metric.md %} diff --git a/v20.1/known-limitations.md b/v20.1/known-limitations.md index cc42eebf192..6c36c33ad07 100644 --- a/v20.1/known-limitations.md +++ b/v20.1/known-limitations.md @@ -6,8 +6,83 @@ toc: true This page describes newly identified limitations in the CockroachDB {{page.release_info.version}} release as well as unresolved limitations identified in earlier releases. +## New limitations + +### `ROLLBACK TO SAVEPOINT` in high-priority transactions containing DDL + +Transactions with [priority `HIGH`](transactions.html#transaction-priorities) that contain DDL and `ROLLBACK TO SAVEPOINT` are not supported, as they could result in a deadlock. For example: + +~~~ sql +> BEGIN PRIORITY HIGH; SAVEPOINT s; CREATE TABLE t(x INT); ROLLBACK TO SAVEPOINT s; +~~~ + +~~~ +ERROR: unimplemented: cannot use ROLLBACK TO SAVEPOINT in a HIGH PRIORITY transaction containing DDL +SQLSTATE: 0A000 +HINT: You have attempted to use a feature that is not yet implemented. +See: https://github.com/cockroachdb/cockroach/issues/46414 +~~~ + +[Tracking Github Issue](https://github.com/cockroachdb/cockroach/issues/46414) + +### Column name from an outer column inside a subquery differs from PostgreSQL + +CockroachDB returns the column name from an outer column inside a subquery as `?column?`, unlike PostgreSQL. For example: + +~~~ sql +> SELECT (SELECT t.*) FROM (VALUES (1)) t(x); +~~~ + +CockroachDB: + +~~~ + ?column? +------------ + 1 +~~~ + +PostgreSQL: + +~~~ + x +--- + 1 +~~~ + +[Tracking Github Issue](https://github.com/cockroachdb/cockroach/issues/46563) + +### Privileges required to access to certain virtual tables differs from PostgreSQL + +Access to certain virtual tables in the `pg_catalog` and `information_schema` schemas require more privileges than in PostgreSQL. For example, in CockroachDB, access to `pg_catalog.pg_types` requires the `SELECT` privilege on the current database, whereas this privilege is not required in PostgreSQL. + +[Tracking Github Issue](https://github.com/cockroachdb/cockroach/issues/43177) + +### Concurrent SQL shells overwrite each other's history + +The [built-in SQL shell](cockroach-sql.html) stores its command history in a single file by default (`.cockroachsql_history`). When running multiple instances of the SQL shell on the same machine, therefore, each shell's command history can get overwritten in unexpected ways. + +As a workaround, set the `COCKROACH_SQL_CLI_HISTORY` environment variable to different values for the two different shells, for example: + +{% include copy-clipboard.html %} +~~~ shell +$ export COCKROACH_SQL_CLI_HISTORY=.cockroachsql_history_shell_1 +~~~ + +{% include copy-clipboard.html %} +~~~ shell +$ export COCKROACH_SQL_CLI_HISTORY=.cockroachsql_history_shell_2 +~~~ + ## Unresolved limitations +### Enterprise `BACKUP` does not capture database/table/column comments + +The [`COMMENT ON`](comment-on.html) statement associates comments to databases, tables, or columns. However, the internal table (`system.comments`) in which these comments are stored is not captured by enterprise [`BACKUP`](backup.html). + +As a workaround, alongside a `BACKUP`, run the [`cockroach dump`](cockroach-dump.html) command with `--dump-mode=schema` for each table in the backup. This will emit `COMMENT ON` statements alongside `CREATE` statements. + +[Tracking Github Issue](https://github.com/cockroachdb/cockroach/issues/44396) + ### Adding stores to a node {% include {{ page.version.version }}/known-limitations/adding-stores-to-node.md %} @@ -33,7 +108,7 @@ An `x` value less than `1` would result in the following error: pq: check constraint violated ~~~ -[Tracking Github Issue](https://github.com/cockroachdb/cockroach/issues/35370) + [Tracking Github Issue](https://github.com/cockroachdb/cockroach/issues/35370) ### Cold starts of large clusters may require manual intervention @@ -126,41 +201,19 @@ For multi-core systems, the user CPU percent can be greater than 100%. Full util [Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/28724) -### `GROUP BY` referring to `SELECT` aliases - -Applications developed for PostgreSQL that use `GROUP BY` to refer to column aliases _produced_ in the same `SELECT` clause must be changed to use the full underlying expression instead. For example, `SELECT x+y AS z ... GROUP BY z` must be changed to `SELECT x+y AS z ... GROUP BY x+y`. Otherwise, CockroachDB will produce either a planning error or, in some cases, invalid results. - -[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/28059) - ### `TRUNCATE` does not behave like `DELETE` `TRUNCATE` is not a DML statement, but instead works as a DDL statement. Its limitations are the same as other DDL statements, which are outlined in [Online Schema Changes: Limitations](online-schema-changes.html#limitations) [Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/27953) -### Using columns in `SELECT` not listed in `GROUP BY` - -Applications developed for PostgreSQL can exploit the fact that PostgreSQL allows a `SELECT` clause to name a column that is not also listed in `GROUP BY` in some cases, for example `SELECT a GROUP BY b`. This is not yet supported by CockroachDB. - -To work around this limitation, and depending on expected results, the rendered columns should be either added at the end of the `GROUP BY` list (e.g., `SELECT a GROUP BY b, a`), or `DISTINCT` should also be used (e.g., `SELECT DISTINCT a GROUP BY b`). - -[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/26709) - -### Cannot `DELETE` multiple rows with self-referencing FKs - -Because CockroachDB checks foreign keys eagerly (i.e., per row), it cannot trivially delete multiple rows from a table with a self-referencing foreign key. - -To successfully delete multiple rows with self-referencing foreign keys, you need to ensure they're deleted in an order that doesn't violate the foreign key constraint. - -[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/25809) - ### `DISTINCT` operations cannot operate over JSON values CockroachDB does not currently key-encode JSON values, which prevents `DISTINCT` filters from working on them. As a workaround, you can return the JSON field's values to a `string` using the `->>` operator, e.g., `SELECT DISTINCT col->>'field'...`. -[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/24436) +[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/35706) ### Current sequence value not checked when updating min/max value @@ -168,14 +221,6 @@ Altering the minimum or maximum value of a series does not check the current val [Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/23719) -### Using common table expressions in `VALUES` and `UNION` clauses - -When the [cost-based optimizer](cost-based-optimizer.html) is disabled, or when it does not support a query, a common table expression defined outside of a `VALUES` or `UNION `clause will not be available inside it. For example `...WITH a AS (...) SELECT ... FROM (VALUES(SELECT * FROM a))`. - -This limitation will be lifted when the cost-based optimizer covers all queries. Until then, applications can work around this limitation by including the entire CTE query in the place where it is used. - -[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/22418) - ### Using `default_int_size` session variable in batch of statements When setting the `default_int_size` [session variable](set-vars.html) in a batch of statements such as `SET default_int_size='int4'; SELECT 1::IN`, the `default_int_size` variable will not take affect until the next statement. This happens because statement parsing takes place asynchronously from statement execution. @@ -184,14 +229,6 @@ As a workaround, set `default_int_size` via your database driver, or ensure that [Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/32846) -### Cannot decommission nodes - -The [`cockroach node decommission`](https://www.cockroachlabs.com/docs/stable/cockroach-node.html#subcommands) command will hang when used to target a set of nodes that cannot be removed without breaking the configured replication rules. - -Example: decommissioning a node in a three node cluster will not work because ranges would become under-replicated. - -[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/18029) - ### Importing data using the PostgreSQL COPY protocol Currently, the built-in SQL shell provided with CockroachDB (`cockroach sql` / `cockroach demo`) does not support importing data using the `COPY` statement. Users can use the `psql` client command provided with PostgreSQL to load this data into CockroachDB instead. For details, see [Import from generic SQL dump](https://www.cockroachlabs.com/docs/stable/import-data.html#import-from-generic-sql-dump). @@ -224,24 +261,36 @@ Most client drivers and frameworks use the text format to pass placeholder value {% include {{ page.version.version }}/known-limitations/partitioning-with-placeholders.md %} -### Adding a column with certain `DEFAULT` values +### Adding a column with sequence-based `DEFAULT` values + +It is currently not possible to [add a column](add-column.html) to a table when the column uses a [sequence](create-sequence.html) as the [`DEFAULT`](default-value.html) value, for example: -It is currently not possible to [add a column](add-column.html) to a table when the column uses a [sequence](create-sequence.html), [computed column](computed-columns.html), or certain evaluated expressions as the [`DEFAULT`](default-value.html) value, for example: +{% include copy-clipboard.html %} +~~~ sql +> CREATE TABLE t (x INT); +~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g INT DEFAULT nextval('initial_seq') +> INSERT INTO t(x) VALUES (1), (2), (3); ~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g OID DEFAULT 'foo'::regclass::oid +> CREATE SEQUENCE s; ~~~ {% include copy-clipboard.html %} ~~~ sql -> ALTER TABLE add_default ADD g INT DEFAULT 'foo'::regtype::INT +> ALTER TABLE t ADD COLUMN y INT DEFAULT nextval('s'); +~~~ + ~~~ +ERROR: nextval(): unimplemented: cannot evaluate scalar expressions containing sequence operations in this context +SQLSTATE: 0A000 +~~~ + +[Tracking GitHub Issue](https://github.com/cockroachdb/cockroach/issues/42508) ### Available capacity metric in the Admin UI @@ -265,14 +314,6 @@ When inserting/updating all columns of a table, and the table has no secondary i This issue is particularly relevant when using a simple SQL table of two columns to [simulate direct KV access](sql-faqs.html#can-i-use-cockroachdb-as-a-key-value-store). In this case, be sure to use the `UPSERT` statement. -### Write and update limits for a single statement - -A single statement can perform at most 64MiB of combined updates. When a statement exceeds these limits, its transaction gets aborted. Currently, `INSERT INTO ... SELECT FROM` and `CREATE TABLE AS SELECT` queries may encounter these limits. - -To increase these limits, you can update the [cluster-wide setting](cluster-settings.html) `kv.raft.command.max_size`, but note that increasing this setting can affect the memory utilization of nodes in the cluster. For `INSERT INTO .. SELECT FROM` queries in particular, another workaround is to manually page through the data you want to insert using separate transactions. - -In the v1.1 release, the limit referred to a whole transaction (i.e., the sum of changes done by all statements) and capped both the number and the size of update. In this release, there's only a size limit, and it applies independently to each statement. Note that even though not directly restricted any more, large transactions can have performance implications on the cluster. - ### Using `\|` to perform a large input in the SQL shell In the [built-in SQL shell](cockroach-sql.html), using the [`\|`](cockroach-sql.html#commands) operator to perform a large number of inputs from a file can cause the server to close the connection. This is because `\|` sends the entire file as a single query to the server, which can exceed the upper bound on the size of a packet the server can accept from any client (16MB). diff --git a/v20.1/migrate-from-oracle.md b/v20.1/migrate-from-oracle.md index 0d3daa43fc1..92ae5fcf21d 100644 --- a/v20.1/migrate-from-oracle.md +++ b/v20.1/migrate-from-oracle.md @@ -226,7 +226,6 @@ When moving from Oracle to CockroachDB data types, consider the following: - [Silent validation error with `DECIMAL` values](known-limitations.html#silent-validation-error-with-decimal-values) - [Schema changes within transactions](known-limitations.html#schema-changes-within-transactions) - [Schema changes between executions of prepared statements](online-schema-changes.html#no-schema-changes-between-executions-of-prepared-statements) -- [Write and update limits for a single statement](known-limitations.html#write-and-update-limits-for-a-single-statement) - If [`JSON`](jsonb.html) columns are used only for payload, consider switching to [`BYTES`](bytes.html). - Max size of a single column family (64 MiB by default).