Re: collision in serial numbers after INSERT? - Mailing list pgsql-general

From Ian Harding
Subject Re: collision in serial numbers after INSERT?
Date
Msg-id 725602300706011408l70eaa5a0y44493101b350bef4@mail.gmail.com
Whole thread Raw
In response to collision in serial numbers after INSERT?  (lawpoop@gmail.com)
List pgsql-general
On 31 May 07 09:46:47 -0700, lawpoop@gmail.com <lawpoop@gmail.com> wrote:
> Hello all -
>
> I'm working on a site with PHP and Postgres, coming from a MySQL
> background.
>
> I was looking for an equivalent to the mysql_insert_id() function, and
> a site recommended this:
>
Another option is INSERT...RETURNING if you can alter your code.  In
my environment it means lying to the system and telling it you are
doing a select when the SQL is actually an insert, but it all works.
If the insert fails, an error is returned, if it succeeds, the
values(s) you asked to have returned are in the result set.

- Ian

pgsql-general by date:

Previous
From: "Alexander Staubo"
Date:
Subject: Re: Slightly OT.
Next
From: "George Pavlov"
Date:
Subject: Re: query log corrupted-looking entries