note 14654 added to function.pg-exec.php
| From: | kleptog at svana dot org | Date: | Wed, 08 Aug 2001 07:25:46 +0000 |
| Subject: | note 14654 added to function.pg-exec.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16467@lists.php.net to get a copy of this message | ||
Just a correction to the earlier post about currval(). It is completely irrelevent what else is
happening. currval() always returns what was returned by the last nextval() *in the current
session*.
So, if you do a nextval() (even an implicit one due to SERIAL) and wait half an hour, currval() will
return that number, even if there have been 3,000 transactions in the meantime.
As for holes in your sequences, thats unavoidable. If holes were to be avoided in the above example,
the database would have to stop all other nextval()s on that sequence until the transaction
committed, not good.
Besides, who cares about a few holes.
You didn't really think a bunch of developers with one of the most advanced concurrency control
systems would let you slip up on that.
http://www.php.net/manual/en/function.pg-exec.php