Re: Test to see if currval will fail?

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Kelly McDonald <w4kpm(at)adelphia(dot)net>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Test to see if currval will fail?
Date: 2002-12-05 22:56:54
Message-ID: web-2023196@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Kelly,

> Is there a test to see if a call to currval will fail? I would like
> to
> call nextval one time per session inside a trigger. I am working on
> other solutions, but I searched the docs and didn't find what I was
> looking for.

You could do "select last_value from <sequence name>" instead.
However, I'm not sure that that method of getting the currval is
session-protected in the way that currval is.

-Josh Berkus

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2002-12-05 23:12:45 Re: Newbee question "Types"
Previous Message Josh Berkus 2002-12-05 22:54:16 Re: Infinite Loop