Re: unlogged sequences

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-03-31T16:28:44Z
Lists: pgsql-hackers
Hi,

On 2022-03-31 16:14:25 +0200, Tomas Vondra wrote:
> 1) Do we need to do something about pg_upgrade? I mean, we did not have
> unlogged sequences until now, so existing databases may have unlogged
> tables with logged sequences. If people run pg_upgrade, what should be
> the end result? Should it convert the sequences to unlogged ones, should
> it fail and force the user to fix this manually, or what?

> 2) Does it actually make sense to force owned sequences to have the same
> relpersistence as the table? I can imagine use cases where it's OK to
> discard and recalculate the data, but I'd still want to ensure unique
> IDs. Like some data loads, for example.


I agree it makes sense to have logged sequences with unlogged tables. We
should call out the behavioural change somewhere prominent in the release
notes.

I don't think we should make pg_upgrade change the loggedness of sequences.

Greetings,

Andres Freund



Commits

  1. Unlogged sequences

  2. Preparatory test cleanup