jurka=# create table t (c serial);
NOTICE: CREATE TABLE will create implicit sequence "t_c_seq" for serial
column "t.c"
CREATE TABLE
jurka=# select currval('t_c_seq');
currval
---------
1
(1 row)
I would expect it to say that currval wasn't set like so:
jurka=# create sequence myseq;
CREATE SEQUENCE
jurka=# select currval('myseq');
ERROR: currval of sequence "myseq" is not yet defined in this session
Kris Jurka