Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence
Date: 2022-07-20 06:56:44
Message-ID: 3dfcd7c4-e133-59f7-f959-0df510682488@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2022-07-20 07:09:20 Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence
Previous Message Sebastien Flaesch 2022-07-20 06:44:10 Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence