Re: sequenc_name.currval not defined - Mailing list pgsql-general

From Philip Hallstrom
Subject Re: sequenc_name.currval not defined
Date
Msg-id 20021121150727.Q72914-100000@cypress.adhesivemedia.com
Whole thread Raw
In response to sequenc_name.currval not defined  (MT <mt@open2web.com>)
List pgsql-general
you have to call nextval() before you can use currval().

On Thu, 21 Nov 2002, MT wrote:

> Hi,
>
> I keep on getting the following error when I attempt to insert a new record:
>
> SELECT * FROM table_name WHERE tableid = currval('tableid_seq');
>
> PostgreSQL said: ERROR: tableid_seq.currval is not yet defined in this
> session.
>
> What's weird about this problem is that I have a script that
> successfully performs this action.
>
> Thanks for your help,
>
> Mark
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>


pgsql-general by date:

Previous
From: "Andy Kriger"
Date:
Subject: how do i find out when a record was created/modified?
Next
From: "scott.marlowe"
Date:
Subject: Re: sequenc_name.currval not defined