Re: function and passing the table name to be used with SQL stmnt

Поиск
Список
Период
Сортировка
От Douglas McNaught
Тема Re: function and passing the table name to be used with SQL stmnt
Дата
Msg-id 878x5kso8c.fsf@suzuka.mcnaught.org
обсуждение исходный текст
Ответ на Re: function and passing the table name to be used with SQL stmnt  (kamiseq <kamiseq@gmail.com>)
Список pgsql-general
kamiseq <kamiseq@gmail.com> writes:

>     select into _id lastval();
> and is that safe operation, can I rely on lastval() that it will
> return value of id that was inserted before?

You want to use currval() with the sequence name.

> can it happened that other user will insert something between my
> insert and select?

currval() specifically written to be safe in this case.

-Doug

В списке pgsql-general по дате отправления:

Предыдущее
От: "Catalin Marinas"
Дата:
Сообщение: Re: Fragments in tsearch2 headline
Следующее
От: paul rivers
Дата:
Сообщение: Re: Partitioning: how to exclude unrelated partitions?