"Simeo Reig" <simreig(at)terra(dot)es> writes:
>> False. Option B is multi-user safe, period. The reason is that currval
>> returns the value last obtained by nextval *in your own session*,
>> independently of what anyone else has done meanwhile.
> What do you understand for *session* ? Same postgres connection ?
Same postgres connection. If you are working in an application
environment that does connection pooling, or some such, then this
is unsafe and you'd better go back to option A.
regards, tom lane