Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence

From: Sebastien Flaesch <sebastien(dot)flaesch(at)4js(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence
Date: 2022-07-19 16:50:28
Message-ID: DBAP191MB12893B2B95B14B2EC2482ED8B08F9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom,
If that's the behavior you want, you can build it out of standard SQL facilities (e.g. update a one-row table).
Can you elaborate please?

Do you mean the code should use an UPDATE on a one-row table to acquire a lock?

Seb

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-07-19 16:50:56 Re: restore question
Previous Message Benedict Holland 2022-07-19 16:49:26 Re: restore question