Re: collision in serial numbers after INSERT?

From: "Ian Harding" <harding(dot)ian(at)gmail(dot)com>
To: "lawpoop(at)gmail(dot)com" <lawpoop(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: collision in serial numbers after INSERT?
Date: 2007-06-01 21:08:58
Message-ID: 725602300706011408l70eaa5a0y44493101b350bef4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 31 May 07 09:46:47 -0700, lawpoop(at)gmail(dot)com <lawpoop(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message George Pavlov 2007-06-01 21:09:04 Re: query log corrupted-looking entries
Previous Message Alexander Staubo 2007-06-01 21:08:50 Re: Slightly OT.