Re: Partitioned tables and [un]loggedness

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Nathan Bossart <nathandbossart@gmail.com>, "David G. Johnston" <david.g.johnston@gmail.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-09-20T00:37:54Z
Lists: pgsql-hackers
On Thu, Sep 19, 2024 at 10:03:09AM +0200, Alvaro Herrera wrote:
> 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.

Makes sense to me, thanks for the suggestion.

What do you think about adding a test with DETACH FINALIZE when
attempting it on a normal table, its path being under a different
subcommand than DETACH [CONCURRENTLY]?

There are no tests for normal tables with DETACH CONCURRENTLY, but as
it is the same as DETACH under the AT_DetachPartition subcommand, that
does not seem worth the extra cycles.
--
Michael

Commits

  1. psql: Remove PARTITION BY clause in tab completion for unlogged tables

  2. Remove support for unlogged on partitioned tables

  3. Remove ATT_TABLE for ALTER TABLE ... ATTACH/DETACH

  4. Introduce ATT_PARTITIONED_TABLE in tablecmds.c

  5. Refactor some code for ALTER TABLE SET LOGGED/UNLOGGED in tablecmds.c

  6. Remove tab completion for CREATE UNLOGGED MATERIALIZED VIEW.