Re: alter table set TABLE ACCESS METHOD
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: 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-03-01T02:16:36Z
Lists: pgsql-hackers
On Sun, Feb 28, 2021 at 04:25:30PM -0600, Justin Pryzby wrote: > I called this "set TABLE access method" rather than just "set access method" > for the reasons given on the LIKE thread: > https://www.postgresql.org/message-id/20210119210331.GN8560@telsasoft.com ALTER TABLE applies to a table (or perhaps a sequence, still..), so that sounds a bit weird to me to add again the keyword "TABLE" for that. > I've tested this with zedstore, but the lack of 2nd, in-core table AM limits > testing possibilities. It also limits at least my own ability to reason about > the AM API. > > For example, I was surprised to hear that toast is a concept that's > intended to be applied to AMs other than heap. > https://www.postgresql.org/message-id/flat/CA%2BTgmoYTuT4sRtviMLOOO%2B79VnDCpCNyy9rK6UZFb7KEAVt21w%40mail.gmail.com What kind of advanced testing do you have in mind? It sounds pretty much enough to me for a basic patch to use the trick with heap2 as your patch does. That would be enough to be sure that the rewrite happens and that data is still around. If you are worrying about recovery, a TAP test with an immediate stop of the server could equally be used to check after the FPWs produced for the new relfilenode during the rewrite. -- 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