Re: Enforcing serial uniqueness?

Поиск
Список
Период
Сортировка
От Steven Brown
Тема Re: Enforcing serial uniqueness?
Дата
Msg-id 44215B91.4080405@ucsd.edu
обсуждение исходный текст
Ответ на Re: Enforcing serial uniqueness?  (Tino Wildenhain <tino@wildenhain.de>)
Список pgsql-general
Tino Wildenhain wrote:

> since your insert above would call nextval() per default,
> its save to use currval() in the same transaction.

Ah, I didn't realize currval() was handled session-local - that removes
my need to support any non-default value to my serial column.  So, if I
can identify use of a non-default value via a trigger, that solves my
first problem.  I'll try writing such a trigger tomorrow.

That leaves only preventing use of setval() as a problem.  If I revoke
UPDATE, it also blocks the use of nextval() by the default value for the
serial column on INSERT.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: invalid page header
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Enforcing serial uniqueness?