Skip to content

HCK-18782: fix double quoting and empty-name rename in index alter script - #212

Merged
taras-dubyk merged 1 commit into
developfrom
fix/HCK-18782-index-rename-quoting
Nov 19, 2026
Merged

taras-dubyk merged 1 commit into
developfrom
fix/HCK-18782-index-rename-quoting

Conversation

@Sylvie-P

@Sylvie-P Sylvie-P commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor
Sub-bugHCK-18782 [PostgreSQL] Alter script generates an invalid ALTER INDEX RENAME for a quoted or cleared index name

## Why

In the alter script, index statements quoted names twice, and clearing an index name produced an invalid rename. HCK-18782

Before: ALTER INDEX IF EXISTS s.""old ix"" RENAME TO "new ix";
After: ALTER INDEX IF EXISTS s."old ix" RENAME TO "new ix";

What to look at

  • The same double quoting was in the tablespace, storage parameters and reindex statements, and on the schema name (""my s"".ix). All four now pass raw names to getNamePrefixedWithSchemaName, like the drop index statement already does.
  • No rename when the old or the new name is empty. Old name empty means the index was created without a name, so PostgreSQL gave it one we don't know; the previous code gave ALTER INDEX IF EXISTS s. RENAME TO "new ix";.
  • Not fixed here: with an empty name on one side, the tablespace and storage parameter statements still target an empty or unknown name (ALTER INDEX IF EXISTS s. SET TABLESPACE b;). Separate follow-up if we want it.

🤖 Generated with Claude Code

…ript

Index and schema names were quoted twice in the rename, tablespace,
storage parameters and reindex statements. A rename is now skipped
when the old or the new index name is empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@Sylvie-P
Sylvie-P marked this pull request as ready for review November 19, 2026 12:12
@Sylvie-P
Sylvie-P requested a review from taras-dubyk November 19, 2026 12:12
@taras-dubyk
taras-dubyk enabled auto-merge (squash) November 19, 2026 12:57
@taras-dubyk
taras-dubyk merged commit ecb797d into develop Nov 19, 2026
7 checks passed
@taras-dubyk
taras-dubyk deleted the fix/HCK-18782-index-rename-quoting branch November 19, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants