Re: Re: sequence integrity insite begin-commit?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rob Brown-Bayliss <rob(at)ZOOstation(dot)cc>
Cc: PGSQL Novice List <pgsql-novice(at)postgresql(dot)org>, Python <python-list(at)python(dot)org>
Subject: Re: Re: sequence integrity insite begin-commit?
Date: 2001-05-23 22:45:56
Message-ID: 22753.990657956@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Rob Brown-Bayliss <rob(at)ZOOstation(dot)cc> writes:
>> So what I am doing is begining a transaction, inserting the data,
>> selecting the last_value from the sequence and then commiting the
>> transaction.

last_value is wrong. currval() will work. See the many prior
discussions of sequences in the mailing list archives.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andrej Kobler 2001-05-24 11:52:42 Using postgresql in a GIS context
Previous Message Rob Brown-Bayliss 2001-05-23 22:17:14 Re: sequence integrity insite begin-commit?