note 48231 deleted from function.pg-last-oid by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 10:13:36 +0000 |
| Subject: | note 48231 deleted from function.pg-last-oid by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196912@lists.php.net to get a copy of this message | ||
Note Submitter: paul at paulmcgarry dot com
----
I do not understand the editors notes in this section.
They seem to suggest that you can't safely use nextval to get an identifier from a sequence
that will be unique accross all users/sessions. That is categorically false.
nextval will pull a number from a sequence and that number is guarunteed to be distinct accross all
sessions.
To quote the Postgres Docs:
"nextval
Advance the sequence object to its next value and return that value. This is done atomically: even
if multiple sessions execute nextval concurrently, each will safely receive a distinct sequence
value."