Re: ALTER INDEX .. RENAME allows to rename tables/views as well - Mailing list pgsql-hackers

From Bossart, Nathan
Subject Re: ALTER INDEX .. RENAME allows to rename tables/views as well
Date
Msg-id F681D64D-8C81-4665-8ABE-D8DCF1A8E511@amazon.com
Whole thread Raw
In response to Re: ALTER INDEX .. RENAME allows to rename tables/views as well  (Bruce Momjian <bruce@momjian.us>)
Responses Re: ALTER INDEX .. RENAME allows to rename tables/views as well  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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


Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: BUG #17212: pg_amcheck fails on checking temporary relations
Next
From: Tom Lane
Date:
Subject: Re: ALTER INDEX .. RENAME allows to rename tables/views as well