Re: ALTER INDEX .. RENAME allows to rename tables/views as well
Nathan Bossart <bossartn@amazon.com>
From: "Bossart, Nathan" <bossartn@amazon.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <bruce@momjian.us>, Onder Kalaci <onderk@microsoft.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2021-10-06T22:55:49Z
Lists: pgsql-hackers
On 10/6/21, 3:44 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote: > "Bossart, Nathan" <bossartn@amazon.com> writes: >> 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. > > ... as, no doubt, are a lot of applications that this will gratuitously > break. We've long had a policy that ALTER TABLE will work on relations > that aren't tables, so long as the requested operation is sensible. Right. > The situation for "ALTER some-other-relation-kind" is a bit more > confused, because some cases throw errors and some don't; but I really > doubt that tightening things up here will earn you anything but > brickbats. I *definitely* don't agree with discarding the policy > about ALTER TABLE, especially if it's only done for RENAME. I think we should at least consider adding this check for ALTER INDEX since we choose a different lock level in that case. 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