Re: Sequence's value can be rollback after a crashed recovery.

Nathan Bossart <bossartn@amazon.com>

From: "Bossart, Nathan" <bossartn@amazon.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>, Jeremy Schneider <schneider@ardentperf.com>, Laurenz Albe <laurenz.albe@cybertec.at>, Andy Fan <zhihui.fan1213@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-11-23T22:13:14Z
Lists: pgsql-hackers
On 11/23/21, 1:41 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> I wrote:
>> I wonder though if we shouldn't try to improve the existing text.
>> The phrasing "never rolled back" seems like it's too easily
>> misinterpreted.  Maybe rewrite the <caution> block like
>> ...
>
> A bit of polishing later, maybe like the attached.

The doc updates look good to me.  Yesterday I suggested possibly
adding a way to ensure that nextval() called in an uncommitted
transaction was persistent, but I think we'd have to also ensure that
synchronous replication waits for those records, too.  Anyway, I don't
think it is unreasonable to require the transaction to be committed to
avoid duplicates from nextval().

Nathan

Commits

  1. Doc: improve documentation about nextval()/setval().