Re: BUG #15954: Unable to alter partitioned table to set logged - Mailing list pgsql-bugs

From Amit Langote
Subject Re: BUG #15954: Unable to alter partitioned table to set logged
Date
Msg-id CA+HiwqFLG=vN3-H3+Xk2ef_iicnoUtA7tNeZfX7JJc7mGJVZ0w@mail.gmail.com
Whole thread Raw
In response to BUG #15954: Unable to alter partitioned table to set logged  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #15954: Unable to alter partitioned table to set logged  (David Rowley <david.rowley@2ndquadrant.com>)
Re: BUG #15954: Unable to alter partitioned table to set logged  (Keith Fiske <keith.fiske@crunchydata.com>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Keith
Date:
Subject: Re: BUG #15947: Worse plan is chosen after giving the planner morefreedom (partitionwise join)
Next
From: David Rowley
Date:
Subject: Re: BUG #15954: Unable to alter partitioned table to set logged