currval of sequence "my_seq" is not yet defined in this session

From: "Nacef LABIDI" <nacef(dot)l(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: currval of sequence "my_seq" is not yet defined in this session
Date: 2008-04-28 22:33:44
Message-ID: f16f7ea00804281533w6bf6ba3ahd4068c8e691ad2cb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi all,

I am writing some code to get the current value of a sequence using the
currval function to use this value in a following insert on another table.
But I am having this message "currval of sequence "my_seq" is not yet
defined in this session".

Can someone explain me what is the problem with that and by the way explain
me the definition of a session in postgres.

I have tried to avoid he problem using a stocked function and a trigger but
I really want to avoid using triggers for debugging issues.

Thanks to all

Nacef

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dana Huggard - Navarik 2008-04-28 22:35:04 Truncate table at a certain size.
Previous Message Lodewijk Voege 2008-04-28 21:47:59 information_schema.referential_constraints permissions