Re: unlogged sequences - Mailing list pgsql-hackers

From Andres Freund
Subject Re: unlogged sequences
Date
Msg-id 20220331162844.yp5uejytqtcpmlw2@alap3.anarazel.de
Whole thread Raw
In response to Re: unlogged sequences  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Responses Re: unlogged sequences  ("David G. Johnston" <david.g.johnston@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: head fails to build on SLES 12 (wal_compression=zstd)
Next
From: Robert Haas
Date:
Subject: Re: pgsql: Add 'basebackup_to_shell' contrib module.