Re: ALTER INDEX .. RENAME allows to rename tables/views as well
Nathan Bossart <bossartn@amazon.com>
From: "Bossart, Nathan" <bossartn@amazon.com>
To: Bruce Momjian <bruce@momjian.us>, Onder Kalaci <onderk@microsoft.com>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2021-10-06T22:35:39Z
Lists: pgsql-hackers
Attachments
- v1-0001-Add-object-type-validation-in-RenameRelation.patch (application/octet-stream) patch v1-0001
On 10/6/21, 1:52 PM, "Bruce Momjian" <bruce@momjian.us> wrote: > I can confirm this bug in git head, and I think it should be fixed. Here's a patch that ERRORs if the object type and statement type do not match. Interestingly, some of the regression tests were relying on this behavior. I considered teaching RenameRelation() how to handle such mismatches, but we have to choose the lock level before we know the object type, so that might be more trouble than it's worth. I'm not too happy with the error message format, but I'm not sure we can do much better without listing all the object types or doing some more invasive refactoring. Nathan
Commits
-
Ensure correct lock level is used in ALTER ... RENAME
- c2c618ff1137 15.0 landed
- 842fe6123c8a 13.5 landed
- 6c8d1c197bd6 12.9 landed
- 3ce3fb2f7dc6 14.1 landed