Re: currval of sequence xxx_seq is not yet defined in this session? - Mailing list pgsql-general

From kenyon
Subject Re: currval of sequence xxx_seq is not yet defined in this session?
Date
Msg-id 1357696680573-5739294.post@n5.nabble.com
Whole thread Raw
In response to Re: currval of sequence xxx_seq is not yet defined in this session?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: currval of sequence xxx_seq is not yet defined in this session?
List pgsql-general
Thanks for your reply!

yeath,I quite accept your opinion,once i guess the drive adds savepoint
between the two SQL,but not sure

i want to get the last insert id to ensure the INSERT correctly ,so i called
currval().

as the error occurs seldom,i find it's difficult to trace the problem or the
logic is doing exactly

later i modified the code looks like:
>select nexval('t_wedding_wedding_id_seq') as Wedding_id;
>insert into t_wedding(wedding_id...) select Wedding_id...;

and in the later pressure tesing never saw the error again.




-----
God believes postgres is Good
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/currval-of-sequence-xxx-seq-is-not-yet-defined-in-this-session-tp5738893p5739294.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Kirk Wythers
Date:
Subject: Re: query by partial timestamp
Next
From: James
Date:
Subject: Installation