Re: ALTER INDEX .. RENAME allows to rename tables/views as well

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>, Onder Kalaci <onderk(at)microsoft(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: ALTER INDEX .. RENAME allows to rename tables/views as well
Date: 2021-10-06 22:35:39
Message-ID: F681D64D-8C81-4665-8ABE-D8DCF1A8E511@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/6/21, 1:52 PM, "Bruce Momjian" <bruce(at)momjian(dot)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 Content-Type Size
v1-0001-Add-object-type-validation-in-RenameRelation.patch application/octet-stream 8.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-10-06 22:43:25 Re: ALTER INDEX .. RENAME allows to rename tables/views as well
Previous Message Peter Geoghegan 2021-10-06 22:20:14 Re: BUG #17212: pg_amcheck fails on checking temporary relations