Re: unlogged sequences - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: unlogged sequences
Date
Msg-id CAKFQuwZptL3V0_jCXEUYn-GUAesVM2h+i0qq-SMZ1z6R+1mtLQ@mail.gmail.com
Whole thread Raw
In response to Re: unlogged sequences  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Thu, Mar 31, 2022 at 6:03 PM Robert Haas <robertmhaas@gmail.com> wrote:

In this new system, does the user still get a logged sequence? If they
get an unlogged sequence, how does dump-and-restore work? What if they
want to still have a logged sequence? But for sequences that are
simply owned, there is no problem here, and I think that inventing one
would not be a good plan.

There is no design problem here, just coding (including special handling for pg_upgrade).  When making a sequence owned we can, without requiring any syntax, choose to change its persistence to match the table owning it.  Or not.  These are basically options 1 and 2 I laid out earlier:


I slightly favor 1, making owned sequences implementation details having a matched persistence mode.  But we seem to be leaning toward option 2 per subsequent emails. I'm ok with that - just give me an easy way to change all my upgraded logged sequences to unlogged.  And probably do the same if I change my table's mode as well.

That there is less implementation complexity is nice but the end user won't see that.  I think the typical end user would appreciate having the sequence stay in sync with the table instead of having to worry about those kinds of details.  Hence my slight favor given toward 1.

David J.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: head fails to build on SLES 12 (wal_compression=zstd)
Next
From: Michael Paquier
Date:
Subject: Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set