Remove support for unlogged on partitioned tables
Michael Paquier <michael@paquier.xyz>
Remove support for unlogged on partitioned tables The following commands were allowed on partitioned tables, with different effects: 1) ALTER TABLE SET [UN]LOGGED did not issue an error, and did not update pg_class.relpersistence. 2) CREATE UNLOGGED TABLE was working with pg_class.relpersistence marked as initially defined, but partitions did not inherit the UNLOGGED property, which was confusing. This commit causes the commands mentioned above to fail for partitioned tables, instead. pg_dump is tweaked so as partitioned tables marked as UNLOGGED ignore the option when dumped from older server versions. pgbench needs a tweak for --unlogged and --partitions=N to ignore the UNLOGGED option on the partitioned tables created, its partitions still being unlogged. Author: Michael Paquier Reviewed-by: Nathan Bossart Discussion: https://postgr.es/m/ZiiyGFTBNkqcMQi_@paquier.xyz
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/alter_table.sgml | modified | +4 −0 |
| doc/src/sgml/ref/create_table.sgml | modified | +4 −0 |
| src/backend/commands/tablecmds.c | modified | +7 −2 |
| src/bin/pgbench/pgbench.c | modified | +1 −1 |
| src/bin/pg_dump/pg_dump.c | modified | +6 −1 |
| src/test/regress/expected/create_table.out | modified | +10 −0 |
| src/test/regress/sql/create_table.sql | modified | +6 −0 |
Documentation touched
Discussion
- Partitioned tables and [un]loggedness 37 messages · 2024-04-24 → 2025-06-11