Search Postgresql Archives

Re: Enforcing serial uniqueness?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux