Knowing when it is safe to call currval()

From: Matthew Horoschun <mhoroschun(at)canprint(dot)com(dot)au>
To: pgsql-sql(at)postgresql(dot)org
Subject: Knowing when it is safe to call currval()
Date: 2003-05-11 04:11:01
Message-ID: 9377CBC6-8366-11D7-B0B7-000393B3A702@canprint.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2003-05-11 04:41:04 Re: Knowing when it is safe to call currval()
Previous Message Tom Lane 2003-05-11 03:19:49 Re: merge-join for domain with underlying type text