Re: BUG #15954: Unable to alter partitioned table to set logged

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, ejberdecia(at)yahoo(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15954: Unable to alter partitioned table to set logged
Date: 2019-08-14 03:17:18
Message-ID: CAKJS1f_spvCFUGOhhXSR1AmKMJ8c3mU7iY=mGUkh85L6eB-WAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, 14 Aug 2019 at 14:48, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Wed, Aug 14, 2019 at 01:57:26PM +1200, David Rowley wrote:
> > I'd say it's broken in a sense that we can create an unlogged
> > partitioned table in the first place. I think that should have been
> > blocked.
>
> I don't think that it is that crazy to be able to define a partitioned
> table as unlogged, assuming that we could use that to make the
> children inherit the same state.

Since we have no persistence inheritance feature, what are you proposing here?

If we allow SET [UN]LOGGED on a partitioned table to cascade down to
each partition, then do we need to insist that the child partition's
persistence setting does not deviate from the parents? Or would
altering the parent just change the partitions that were not already
set that way?

What would the behaviour be of doing ATTACH PARTITION on a logged
table onto an unlogged partitioned table?

Also, since there is no CREATE LOGGED TABLE syntax, what would users
do if that wanted to create a logged partition on an unlogged
partition hierarchy? For this to work ATTACH PARTITION would have to
not mess with the persistence setting but the user would have to
CREATE TABLE ... (LIKE partitioned_table); then ATTACH PARTITION.
That seems a bit messy to me, it's inevitable that someone would
eventually complain and ask for a CREATE LOGGED TABLE syntax.

I think if we don't allow mixed persistence partition hierarchies
we'll get complaints. I think it's valid to have them, just imagine
implementing a highspeed queue that does not require durability on
non-processed items. Processing an item updates the "processed" flag
which moves the tuple into a logged partition, thus making it durable.

So my thoughts are that unless someone is proposing to think of all
the corner cases for partitions inheriting their persistence from
their partitioned table, then allowing UNLOGGED partitioned tables is
busted.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message easteregg 2019-08-14 03:23:53 RE: BUG #15953: performance issues using 11.5-1.pgdg+1 over 11.5-1
Previous Message Efrain J. Berdecia 2019-08-14 02:51:27 Re: BUG #15954: Unable to alter partitioned table to set log