Hi Tom,
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: 02 February 2005 15:35
> To: Mark Cave-Ayland
> Cc: 'Alvaro Herrera'; 'Michael Fuhr'; 'Mitch Pirtle'; 'Tatsuo
> Ishii'; pgsql-hackers@postgresql.org; operationsengineer1@yahoo.com
> Subject: Re: [NOVICE] Last ID Problem
(cut)
> No. The thing everyone is ignoring here is that the INSERT
> command tag format is not something we can just go and
> change. You certainly could not put anything in it that
> wasn't an integer, and I'm not sure it would even be safe to
> put a bigint. So most of the cases you might actually want
> (timestamp, bigserial, etc) would be ruled out. Hardly worth
> inventing such a feature.
OK, I didn't realise it was the command tag that was the issue here. I took
a look at the libpq source to see how the INSERT tag works and it looks like
it currently assumes a string of numbers. So as a minimum it would need some
form of protocol extension to get this work (which I see from the archives
that you were not keen to pursue).
> How is what you're suggesting more portable?
I was hoping that it would only require minimal change (but obviously that
is not the case). I think, out of the remaining options, that keeping with
currval() is going to be the best approach - I can't really see the benefit
of using a non-SQL standard command just for SQL insertion, mainly as you
and others have suggested for portability reasons :(
Kind regards,
Mark.
------------------------
WebBased Ltd
South West Technology Centre
Tamar Science Park
Plymouth
PL6 8BT
T: +44 (0)1752 791021
F: +44 (0)1752 791023
W: http://www.webbased.co.uk