-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: Cannot add and drop (or drop and add) index in same transaction #42844
Copy link
Copy link
Closed
Labels
A-schema-transactionalA-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)X-anchored-telemetryThe issue number is anchored by telemetry references.The issue number is anchored by telemetry references.
Description
Describe the problem
It is not possible to add and drop an index (in either order) within the same transaction
To Reproduce
drop index foo cascade;
alter table t add constraint foo unique(x);
commit;
pq: index "foo" being dropped, try again later```
```root@:26257/defaultdb> begin;
alter table t add constraint foo unique(x);
drop index foo cascade;
commit;
pq: index "foo" in the middle of being added, try again later```
Setting `sql_safe_updates = FALSE` allows this behavior.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-schema-transactionalA-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLT-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)X-anchored-telemetryThe issue number is anchored by telemetry references.The issue number is anchored by telemetry references.