Re: collision in serial numbers after INSERT?

Поиск
Список
Период
Сортировка
От Ian Harding
Тема Re: collision in serial numbers after INSERT?
Дата
Msg-id 725602300706011408l70eaa5a0y44493101b350bef4@mail.gmail.com
обсуждение исходный текст
Ответ на collision in serial numbers after INSERT?  (lawpoop@gmail.com)
Список 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 по дате отправления:

Предыдущее
От: "Alexander Staubo"
Дата:
Сообщение: Re: Slightly OT.
Следующее
От: "George Pavlov"
Дата:
Сообщение: Re: query log corrupted-looking entries