On Wed, Aug 14, 2019 at 3:06 AM PG Bug reporting form <noreply@postgresql.org> wrote: > The following bug has been logged on the website: > > Bug reference: 15954 > Logged by: Efrain Berdecia > Email address: ejberdecia@yahoo.com > PostgreSQL version: 11.1 > Operating system: Centos7 > Description: > > I have a partition table that I created unlogged. I'm using pg_partman to > manage the partition. I then proceeded to load data into it with a COPY > command. > > Afterwards, I ran an alter table set logged on the parent table but the > table still shows as UNLOGGED along with all its children. > > Is this broken?
It is somewhat. A workaround is to perform ALTER TABLE SET LOGGED individually on each partition. Specifying LOGGED / UNLOGGED for the parent table is useless as things stand now.
Are you sure by the way that the individual partitions are themselves UNLOGGED when you created them? Partitions don't inherit the logged-ness property from the parent table, so you must explicitly create a partition using CREATE UNLOGGED TABLE ... PARTITION OF ... if you want it to be unlogged.
Thanks, Amit
This is a feature of pg_partman itself and was implemented before native partitioning. I check the UNLOGGED status of the parent and set the children appropriately with explicit statements as you say here..