Re: Foreign key error, please help. - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: Foreign key error, please help.
Date
Msg-id 20050309152100.GB7213@wolff.to
Whole thread Raw
In response to Re: Foreign key error, please help.  (Kumar S <ps_postgres@yahoo.com>)
List pgsql-novice
On Wed, Mar 09, 2005 at 06:46:45 -0800,
  Kumar S <ps_postgres@yahoo.com> wrote:
> Hi Stephan,
> Thank you very much, it was my stupid mistake.
>
> One more question. aplogies if this is also not so
> worthy question.
> In a transaction does currval work only if a previous
> statement defines it.  In my case I wanted to get FK
> from existing currval in sample table (sample_id).
> when I execute my statements in a transasction, I get
> the following error. Do I have to just use a SELECT
> statement here, because currval is not working? Or did
> i made a mistake instead?

If you haven't used nextval in the current session, currval doesn't have
a value yet, so you can't use it. Which value would you expect it to use?

pgsql-novice by date:

Previous
From: Kumar S
Date:
Subject: Re: Foreign key error, please help.
Next
From: "Keith Worthington"
Date:
Subject: When are trigger function results committed