Jan Poslusny <pajout@gingerall.cz> writes:
> Hi,
> select currval('sequence_name');
> with quotes should help you. But my pg 7.1.2 throws error
> "sequence_name.currval is not yet defined in this session" (possibly
> bug ?). If I use sequence before calling this (for instance "insert
> into mytable values(nextval('sequence_name'));" ), all is OK.
This is documented behavior. See the FAQ and the docs.
-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863