mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
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
This commit is contained in:
@@ -4865,7 +4865,7 @@ initCreateTables(PGconn *con)
|
||||
|
||||
/* Construct new create table statement. */
|
||||
printfPQExpBuffer(&query, "create%s table %s(%s)",
|
||||
unlogged_tables ? " unlogged" : "",
|
||||
(unlogged_tables && partition_method == PART_NONE) ? " unlogged" : "",
|
||||
ddl->table,
|
||||
(scale >= SCALE_32BIT_THRESHOLD) ? ddl->bigcols : ddl->smcols);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user