[cvsnt-dev] Re: postgres doesn't do INSERT ... RETURNS

Tony Hoyle tony.hoyle at march-hare.com
Mon Jul 24 15:16:33 UTC 2006


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


David Somers wrote:
> BTW, I just committed a change to PostgresRecordset.cpp so the result set
> will correctly parse ints... so now it DOES pick up the correct version
> from schemaversion... unfortunately, with the aforementioned RETURNING the
> subsequent INSERT into SessionLog will fail.

You might be able to use currval() - according to the docs 
http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html the 
return value to this is local to the session (so shouldn't be affect by other 
connections).

Something like insert ... into sessionlog select currval('sessionlog_id_seq')

Tony


More information about the cvsnt-dev mailing list