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-08-10T03:24:13Z
Lists: pgsql-hackers
On Sat, Aug 07, 2021 at 07:18:19PM +0900, Michael Paquier wrote: > As a matter of curiosity, I have checked how it would look to handle > the no-op case for the sub-commands other than SET TABLESPACE, and one > would need something like the attached, with a new flag for > AlteredTableInfo. That does not really look good, but it triggers > properly the object access hook when SET LOGGED/UNLOGGED/ACCESS METHOD > are no-ops, so let's just handle the case using the version from > upthread. I'll do that at the beginning of next week. So, on a closer look, it happens that this breaks the regression tests of sepgsql, as the two following commands in ddl.sql cause a rewrite: ALTER TABLE regtest_table_4 ALTER COLUMN y TYPE float; ALTER TABLE regtest_ptable_4 ALTER COLUMN y TYPE float; I have been fighting with SE/Linux for a couple of hours to try to figure out how to run our regression tests, but gave up after running into various segmentation faults even after following all the steps of the documentation to set up things. Perhaps that's because I just set up the environment with a recent Debian, I don't know. Instead of running those tests, I have fallen back to my own module and ran all the SQLs of sepgsql to find out places where there are rewrites where I spotted those two places. One thing I have noticed is that sepgsql-regtest.te fails to compile because /usr/share/selinux/devel/Makefile does not understand auth_read_passwd(). Looking at some of the SE/Linux repos, perhaps this ought to be auth_read_shadow() instead to be able to work with a newer version? Anyway, as the addition of this InvokeObjectPostAlterHook() is consistent for a rewrite caused by SET LOGGED/UNLOGGED/ACCESS METHOD I have applied the patch. I'll fix rhinoceros once it reports back the diffs in output. -- 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