From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joel Stevenson <jstevenson@bearriver.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: SERIAL Field
Date: Mon, 06 May 2002 16:16:31 -0400
Message-ID: <18254.1020716191@sss.pgh.pa.us> (raw)
In-Reply-To: <a05111709b8fc88c96775@[192.168.1.100]>
References: <20010507124341.00EE03F43@bast.unixathome.org>
<20010507142738.DE7B63F43@bast.unixathome.org>
<a05111709b8fc88c96775@[192.168.1.100]>
Joel Stevenson <jstevenson@bearriver.com> writes:
> Though, if you have multiple clients inserting into the table, there
> is a chance that between client A inserting the record and then
> calling currval(), client B could have performed an insert, in which
> case client A gets the value of client B's record. 'nextval() +
> write' avoids this possible overlap.
People who have not studied the documentation frequently make that
claim. *There is no such risk* (unless A and B are interleaving their
commands on a single database connection, in which case they have lots
worse risks of conflicts than this one). See
http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/functions-sequence.html
regards, tom lane
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, jstevenson@bearriver.com
Subject: Re: SERIAL Field
In-Reply-To: <18254.1020716191@sss.pgh.pa.us>
References: <20010507124341.00EE03F43@bast.unixathome.org> <20010507142738.DE7B63F43@bast.unixathome.org> <a05111709b8fc88c96775@[192.168.1.100]> <18254.1020716191@sss.pgh.pa.us>
* 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