Billy G. Allie wrote:

Vadim B. Mikheev wrote:
Billy G. Allie wrote:
I encountered a problem (bug? feature?) where "select currval('sequence')"
will generate an error if "select nextval('sequence')" is not executed
first.
This is feature :)
1. This is what Oracle does.
2. currval () is described as returning value returned by
last nextval() in _session_.

Vadim
Does this mean we should not modify this behavior because "this is what Oracle
does"? I can envision where using currval() before nextval() can be useful.
Actually, what you are proposing was initial behaviour of currval().
This was changed to be more consistent with 1. & 2. (note - not only 1.,
but 2. also).

But personally I haven't objection against changing this again.
Men, vote pls!

Vadim

No, I would not change this again, my question is iff instead of elog(ERROR
the old code could be reinserted. This would mean, that when a session did a
previous nextval it gets it's session currval, but if it did not, it gets a global
currval as in previous implementation. The problem is somebody who
calls currval often without ever calling nextval (like a monitor) will totally kill
performance. (same as a select max(field))

Andreas

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedMar 6, '98 at 1:06p
activeMar 6, '98 at 1:06p
posts1
users1
websitepostgresql.org...
irc#postgresql

1 user in discussion

Zeugswetter Andreas: 1 post

People

Translate

site design / logo © 2022 Grokbase