> currval returns error unless nextval has been called at least once in the
> session.
But in my example, which is
> > > create table t1 (recordid SERIAL PRIMARY KEY, val INT4, name TEXT);
> > > ... much later ...
> > > insert into t1 (val, name) values (3465, 'blah');
> > > -- now we want the recordid just created
it's ok because a NULL insert into a SERIAL implicitly calls nextval.
Florent