| From: | "Quentin de Metz" <quentin(at)de(dot)me(dot)tz> |
|---|---|
| To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Steve Baldwin" <steve(dot)baldwin(at)gmail(dot)com> |
| Cc: | pgsql-novice(at)lists(dot)postgresql(dot)org |
| Subject: | Re: pg_dump not properly dumping unlogged partitioned tables |
| Date: | 2026-07-27 06:26:54 |
| Message-ID: | 7df60e0e-4f63-4c4c-af1a-60a67f5c76b9@app.fastmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
Thank you both 🙏
On Mon, Jul 27, 2026, at 05:24, Tom Lane wrote:
> Steve Baldwin <steve(dot)baldwin(at)gmail(dot)com> writes:
>> Not sure what this means but the v18 docs say that unlogged is not
>> supported for partitioned tables, so maybe this was true for v17 but not
>> documented.
>
> Yeah, if you try it on v18 or later:
>
> regression=# CREATE UNLOGGED TABLE zde (id bigint) PARTITION BY RANGE(id);
> ERROR: partitioned tables cannot be unlogged
>
> v18 pg_dump is aware of this and deliberately suppresses the UNLOGGED
> property, reasoning that that beats hitting this failure during
> reload. See:
>
>
> commit e2bab2d792044b55dd092bf1c2be0d570ccb9401
> Author: Michael Paquier <michael(at)paquier(dot)xyz>
> Date: Thu Oct 3 10:55:02 2024 +0900
>
> 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
>
>
> regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrea | 2026-07-29 13:56:13 | Repo checksum mismatch |
| Previous Message | Tom Lane | 2026-07-27 03:24:31 | Re: pg_dump not properly dumping unlogged partitioned tables |