>
>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-l
Joel Stevenson <[EMAIL PROTECTED]> 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
> > "You say nextval() + write, I say write + currval()..."
>
>So long as a given application does not mix the two approaches, everything
>should be fine.
Though, if you have multiple clients inserting into the table, there
is a chance that between client A inserting the record and then
callin
2, Joel Burton wrote:
>
> > -Original Message-
> > From: Dan Langille [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, May 06, 2002 12:41 PM
> > To: Joel Burton
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [ADMIN] SERIAL Field
> >
> >
On 6 May 2002 at 12:43, Joel Burton wrote:
> > -Original Message-
> > From: Dan Langille [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, May 06, 2002 12:41 PM
> > To: Joel Burton
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [ADMIN] SERIAL Field
> >
> -Original Message-
> From: Dan Langille [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 06, 2002 12:41 PM
> To: Joel Burton
> Cc: [EMAIL PROTECTED]
> Subject: Re: [ADMIN] SERIAL Field
>
> > In any event, inserting then using currval() is the standard pract
On 6 May 2002 at 10:51, Joel Burton wrote:
> > But the very idea of inserting the value and then retriving the sequence
> > number sounds fishy to me. Why not get the sequence number first and than
> > insert using that seqnce number (more on the flash tutorial ).
That's pretty standard in a num
> -Original Message-
> From: Joel Burton [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 06, 2002 10:51 AM
> To: Rajesh Kumar Mallah.; Gaetano Mendola; [EMAIL PROTECTED]
> Subject: RE: [ADMIN] SERIAL Field
>
>
> > -Original Message-
> > From: [EM
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Rajesh Kumar
> Mallah.
> Sent: Monday, May 06, 2002 9:26 AM
> To: Gaetano Mendola; [EMAIL PROTECTED]
> Subject: Re: [ADMIN] SERIAL Field
> But the very idea of inserting the
Hi Gaetano,
Postgresql implements serial field using sequences.
detailed description of sequences are avaliable at
http://www.postgresql.org/idocs/index.php?functions-sequence.html
a NICE flash tutorial is also available at:
http://techdocs.postgresql.org/college/001_sequences/
the specific a
> Hi all,
>
> having a table with a serial field what is the corrected method
> to retrieve the value after an insert ?
Use currval(_name_of_sequence_):
joel=# create table test ( id serial );
NOTICE: CREATE TABLE will create implicit sequence 'test_id_seq' for SERIAL
column 'test.id'
NOTICE:
11 matches
Mail list logo