You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
root@localhost:26257/defaultdb> create table foo (i int, j int);
CREATE TABLE
root@localhost:26257/defaultdb> begin;
BEGIN
root@localhost:26257/defaultdb OPEN> insert into foo values (1,2);
INSERT 1
root@localhost:26257/defaultdb OPEN> create table t();
ERROR: unimplemented: schema change statement cannot follow a statement that has written in the same transaction
SQLSTATE: 0A000
HINT: You have attempted to use a feature that is not yet implemented.
See: https://go.crdb.dev/issue-v/26508/v21.1
Although it says "schema change statement cannot follow a statement that has written in the same transaction", one can successfully preform a schema change after a write in a txn:
root@localhost:26257/defaultdb OPEN> create table foo (i int, j int);
CREATE TABLE
root@localhost:26257/defaultdb OPEN> create table bar (j int);
CREATE TABLE
root@localhost:26257/defaultdb> begin;
BEGIN
root@localhost:26257/defaultdb OPEN> alter table bar drop column j;
ALTER TABLE
root@localhost:26257/defaultdb OPEN> insert into foo values (1,2);
INSERT 1
root@localhost:26257/defaultdb OPEN> create table t();
CREATE TABLE
root@localhost:26257/defaultdb OPEN> commit;
COMMIT
The error message should be updated to say that we do not support DDLs if the first write in a txn precedes the first DDL. h in the txn
jayshrivastava
added
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
and removed
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
labels
Dec 21, 2020
The following error is misleading:
Although it says "schema change statement cannot follow a statement that has written in the same transaction", one can successfully preform a schema change after a write in a txn:
The error message should be updated to say that we do not support DDLs if the first write in a txn precedes the first DDL. h in the txn
This issue relates to #54477.
The text was updated successfully, but these errors were encountered: