Tom Lane wrote:
This definition is OK with me ... so long as it still includes the
phrase "an error occurs if no nextval or setval has occurred in the
current session". However it seemed that a number of people asking for the feature wanted some-random-default to be returned instead.


Right -- I think it definitely needs to return an error in that situation. Per my earlier mail, the other debatable behavior is whether lastval() should be defined if the sequence it would be returning the currval() for has been subsequently dropped. I'm inclined to not return an error here to simplify the implementation, but I'm open to objections.

Another question is why should setval affect the result?  I don't
see the use-case for that offhand.

I'm not militant about it, but having setval() affect the result means lastval() is more consistent with currval().

-Neil

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to