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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, keith(dot)fiske(at)crunchydata(dot)com, ejberdecia(at)yahoo(dot)com, david(dot)rowley(at)2ndquadrant(dot)com, amitlangote09(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15954: Unable to alter partitioned table to set logged
Date: 2024-04-23 05:37:56
Message-ID: ZidJNJzvnDVLsgtB@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Apr 22, 2024 at 12:36:20PM -0700, David G. Johnston wrote:
> There is little upside to preventing the existence of an unlogged
> partitioned table at this point. I have just submitted a doc patch to deal
> with that side of the equation.

I would not object to that. However, now that we're five years into
this problem, I'd rather treat that as a new entire feature than
change the existing behavior in the back branches.

Not changing unlogged property of a partitioned table on ALTER TABLE
is of course no good. However, we also ignore the fact that a
partitioned table is unlogged when we create its partitions, and there
is a point in making partitions inherit this property from the parent.
So, my take would be:
- To switch the relpersistence of a partitioned table on ALTER TABLE,
without touching any of its partitions.
- New partitions should inherit the unlogged property of the parent.
- pg_dump should not need tweaks to be able to cope with that, as
loggedness is part of the CREATE queries.

Compared to the recent experiences around tablespaces and table AMs,
this should be less complicated with code paths for relations without
storage in tablecmds.c.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2024-04-23 07:48:12 Re: BUG #18146: Rows reappearing in Tables after Auto-Vacuum Failure in PostgreSQL on Windows
Previous Message David Rowley 2024-04-22 22:56:23 Re: BUG #18442: Unnecessary Sort operator in indexScan Plan