Re: alter table set TABLE ACCESS METHOD
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, vignesh C <vignesh21@gmail.com>, pgsql-hackers@postgresql.org, Jacob Champion <pchampion@vmware.com>, Heikki Linnakangas <hlinnaka@iki.fi>, Ashwin Agrawal <aagrawal@pivotal.io>, Ashutosh Sharma <ashu.coek88@gmail.com>, Andres Freund <andres@anarazel.de>, Robert Haas <robertmhaas@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Dilip Kumar <dilipbalaut@gmail.com>
Date: 2021-07-30T07:22:19Z
Lists: pgsql-hackers
On Thu, Jul 29, 2021 at 08:55:21AM -0700, Jeff Davis wrote: > I see that ATExecSetTableSpace() also invokes the hook even for a no- > op. Should we do the same thing for setting the AM? Looking at the past, it was the intention of 05f3f9c7 to go through the hook even if SET TABLESPACE does not move the relation, so you are right that ALTER TABLE is inconsistent to not do the same for LOGGED, UNLOGGED and ACCESS METHOD if all of them do nothing to trigger a relation rewrite. Now, I am a bit biased about this change and if we actually need it for the no-op path. If we were to do that, I think that we need to add in AlteredTableInfo a way to track down if any of those subcommands have been used to allow the case of rewrite == 0 to launch the hook even if these are no-ops. And I am not sure if that's worth the code complication for an edge case. We definitely should have a hook call for the case of rewrite > 0, though. -- Michael
Commits
-
Allow specifying an access method for partitioned tables
- 374c7a229042 17.0 landed
-
Fix regression test output of sepgsql
- 1e3445237b86 15.0 landed
-
Add call to object access hook at the end of table rewrite in ALTER TABLE
- 7b565843a944 15.0 landed
-
Fix typo in tab-complete.c
- 15c6ede04577 15.0 landed
-
Add support for SET ACCESS METHOD in ALTER TABLE
- b0483263dda0 15.0 landed
-
tableam: introduce table AM infrastructure.
- 8586bf7ed888 12.0 cited