Knowing when it is safe to call currval() - Mailing list pgsql-sql

From Matthew Horoschun
Subject Knowing when it is safe to call currval()
Date
Msg-id 9377CBC6-8366-11D7-B0B7-000393B3A702@canprint.com.au
Whole thread Raw
Responses Re: Knowing when it is safe to call currval()
List pgsql-sql
Hi All,

Is there any way to know ahead of time whether calling currval() on a 
sequence will cause an exception like:

ERROR:  some_id_seq.currval is not yet defined in this session

In my function I can't be sure whether nextval() will have previously 
been called in the session.

Thanks

Matthew.



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: merge-join for domain with underlying type text
Next
From: Bruno Wolff III
Date:
Subject: Re: Knowing when it is safe to call currval()