Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: support transactionally dropping an index and creating one with the same name #98494

Open
ajwerner opened this issue Mar 13, 2023 · 1 comment
Labels
A-schema-transactional C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@ajwerner
Copy link
Contributor

ajwerner commented Mar 13, 2023

Is your feature request related to a problem? Please describe.
Today, if you try this, you'll get an error.

root@localhost:26257/defaultdb> create table foo (i int primary key, j int);
CREATE TABLE
root@localhost:26257/defaultdb> create index idx on foo(j);
CREATE INDEX
root@localhost:26257/defaultdb> begin;
BEGIN
root@localhost:26257/defaultdb  OPEN> drop index idx;
NOTICE: the data for dropped indexes is reclaimed asynchronously
HINT: The reclamation delay can be customized in the zone configuration for the table.
DROP INDEX
root@localhost:26257/defaultdb  OPEN> create index idx on foo(j);
ERROR: index "idx" being dropped, try again later
SQLSTATE: 55000

Describe the solution you'd like
It should just work. The declarative schema changer will make this straightforward.

Additional context
This is hard to fix in the legacy schema changer.

Jira issue: CRDB-25297

@ajwerner ajwerner added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-schema-transactional labels Mar 13, 2023
@blathers-crl blathers-crl bot added the T-sql-schema-deprecated Use T-sql-foundations instead label Mar 13, 2023
@exalate-issue-sync exalate-issue-sync bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) and removed T-sql-schema-deprecated Use T-sql-foundations instead labels May 10, 2023
@Jolg42
Copy link

Jolg42 commented Aug 28, 2023

(Random find) I could reproduce this on CockroachDB v23.1

And I opened a separate issue for columns #109587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-schema-transactional C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

2 participants