Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence
Date
Msg-id 3dfcd7c4-e133-59f7-f959-0df510682488@gmx.net
Whole thread Raw
In response to Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence  (Sebastien Flaesch <sebastien.flaesch@4js.com>)
Responses Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence  (Sebastien Flaesch <sebastien.flaesch@4js.com>)
List pgsql-general
Sebastien Flaesch schrieb am 19.07.2022 um 18:50:
> 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?

I assume something like this:

https://blog.sql-workbench.eu/post/gapless-sequence/





pgsql-general by date:

Previous
From: Sebastien Flaesch
Date:
Subject: Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence
Next
From: Francisco Olarte
Date:
Subject: Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence