On Fri, Nov 08, 2002 at 16:02:07 +0000,
Rory Campbell-Lange <mail@campbell-lange.net> wrote:
> The problem is that I need to use the id for naming an image file.
> Consequently I need the id from the insert. You will note (from my
> original messgage) that I'm already using a SERIAL type field for the id
> column.
Then you can select currval of the associated sequence.
currval returns the last value of the sequence assigned by this backend.
So as long as it is the same connection that did the insert and nothing
else using this connection has modified the sequence since the insert,
this will work.