Re: Partitioned tables and [un]loggedness
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-08-29T14:49:44Z
Lists: pgsql-hackers
On Thu, Aug 29, 2024 at 03:44:45PM +0900, Michael Paquier wrote: > On Tue, Aug 27, 2024 at 04:01:58PM -0500, Nathan Bossart wrote: >> My current thinking is that it would be better to disallow marking >> partitioned tables as LOGGED/UNLOGGED and continue to have users explicitly >> specify what they want for each partition. It'd still probably be good to >> expand the documentation, but a clear ERROR when trying to set a >> partitioned table as UNLOGGED would hopefully clue folks in. > > The addition of the new LOGGED keyword is not required if we limit > ourselves to an error when defining UNLOGGED, so if we drop this > proposal, let's also drop this part entirely and keep DefineRelation() > simpler. +1 > Actually, is really issuing an error the best thing we can > do after so many years allowing this grammar flavor to go through, > even if it is perhaps accidental? relpersistence is marked correctly > for partitioned tables, it's just useless. Expanding the > documentation sounds fine to me, one way or the other, to tell what > happens with partitioned tables. IMHO continuing to allow partitioned tables to be marked UNLOGGED just preserves the illusion that it does something. An ERROR could help dispel that misconception. -- nathan
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