Re: Partitioned tables and [un]loggedness
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Michael Paquier <michael@paquier.xyz>
Cc: Nathan Bossart <nathandbossart@gmail.com>, "David G. Johnston" <david.g.johnston@gmail.com>,
Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-09-19T08:03:09Z
Lists: pgsql-hackers
Attachments
On 2024-Sep-10, Michael Paquier wrote: > @@ -5060,17 +5061,17 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd, > pass = AT_PASS_MISC; > break; > case AT_AttachPartition: > - ATSimplePermissions(cmd->subtype, rel, ATT_TABLE | ATT_PARTITIONED_INDEX); > + ATSimplePermissions(cmd->subtype, rel, ATT_TABLE | ATT_PARTITIONED_TABLE | ATT_PARTITIONED_INDEX); > /* No command-specific prep needed */ > pass = AT_PASS_MISC; > break; > case AT_DetachPartition: > - ATSimplePermissions(cmd->subtype, rel, ATT_TABLE); > + ATSimplePermissions(cmd->subtype, rel, ATT_TABLE | ATT_PARTITIONED_TABLE); > /* No command-specific prep needed */ > pass = AT_PASS_MISC; > break; > case AT_DetachPartitionFinalize: > - ATSimplePermissions(cmd->subtype, rel, ATT_TABLE); > + ATSimplePermissions(cmd->subtype, rel, ATT_TABLE | ATT_PARTITIONED_TABLE); > /* No command-specific prep needed */ > pass = AT_PASS_MISC; > break; It looks to me like these cases could be modified to accept only ATT_PARTITIONED_TABLE, not ATT_TABLE anymore. The ATT_TABLE cases are useless anyway, because they're rejected by transformPartitionCmd. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
Commits
-
psql: Remove PARTITION BY clause in tab completion for unlogged tables
- 361499538c9d 18.0 landed
-
Remove support for unlogged on partitioned tables
- e2bab2d79204 18.0 landed
-
Remove ATT_TABLE for ALTER TABLE ... ATTACH/DETACH
- bbba59e69a56 18.0 landed
-
Introduce ATT_PARTITIONED_TABLE in tablecmds.c
- d69a3f4d70b7 18.0 landed
-
Refactor some code for ALTER TABLE SET LOGGED/UNLOGGED in tablecmds.c
- 9f87da1cffda 18.0 landed
-
Remove tab completion for CREATE UNLOGGED MATERIALIZED VIEW.
- 5c1ce1bbbe5f 18.0 cited