pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sebastien Flaesch <sebastien.flaesch@4js.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence
Date: Tue, 19 Jul 2022 16:50:28 +0000
Message-ID: <DBAP191MB12893B2B95B14B2EC2482ED8B08F9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <1156239.1658245261@sss.pgh.pa.us>
References: <DBAP191MB1289AC6BB681A44166256884B08F9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
	<1156239.1658245261@sss.pgh.pa.us>

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

view thread (10+ messages)  latest in thread

Message-ID: <DBAP191MB12893B2B95B14B2EC2482ED8B08F9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
Permalink:  ../DBAP191MB12893B2B95B14B2EC2482ED8B08F9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM/
Also on:    postgresql.org/message-id/DBAP191MB12893B2B95B14B2EC2482ED8B08F9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: sebastien.flaesch@4js.com, tgl@sss.pgh.pa.us
  Subject: Re: Concurrent INSERT statements with RETURNING clause resetting SERIAL sequence
  In-Reply-To: <DBAP191MB12893B2B95B14B2EC2482ED8B08F9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
  References: <DBAP191MB1289AC6BB681A44166256884B08F9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM> <1156239.1658245261@sss.pgh.pa.us> <DBAP191MB12893B2B95B14B2EC2482ED8B08F9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox