Re: Fw: postgresql experts please help

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Fw: postgresql experts please help
Дата
Msg-id 200710181257.37449.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: Fw: postgresql experts please help  (Kris Jurka <books@ejurka.com>)
Ответы Re: Fw: postgresql experts please help  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
Kris,

> If you have an after trigger on the table that you're inserting into and
> it inserts into another table with a serial column, the lastval call will
> use the wrong sequence.  Now this is also a problem with currval if you
> have a trigger that inserts into the same table, but that's an unlikely
> application design.  Inserting into another table is something that you'll
> find with systems that do auditing or sometimes horizontal partitioning of
> a table.

I'm pretty sure there's a version of lastval() which takes the table name as a
parameter.  That would be the safer one to use.

--
Josh Berkus
PostgreSQL @ Sun
San Francisco

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Fw: postgresql experts please help
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Fw: postgresql experts please help