Skip to content

[YSQL] adding a unique constraint "USING INDEX" doesn't rename the index #26276

Closed
@fizaaluthra

Description

@fizaaluthra

Jira Link: DB-15621

Description

eg:

yugabyte=# CREATE TABLE x (t int);
yugabyte=# CREATE UNIQUE INDEX x_t ON x(t);
yugabyte=# ALTER TABLE x ADD CONSTRAINT x_t_unique UNIQUE USING INDEX x_t;
NOTICE:  ALTER TABLE / ADD CONSTRAINT USING INDEX will rename index "x_t" to "x_t_unique"

As per the notice, the pg relname for the index changes:

yugabyte=# SELECT COUNT(*) FROM pg_class WHERE relname='x_t';
 count 
-------
     0
(1 row)

yugabyte=# SELECT COUNT(*) FROM pg_class WHERE relname='x_t_unique';
 count 
-------
     1
(1 row)

But the rename isn't reflected on the DocDB schema for the index.

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions