GETTING INFO FROM SEQUENCE OBJECTS

From: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: GETTING INFO FROM SEQUENCE OBJECTS
Date: 2009-11-02 19:16:37
Message-ID: f03943a00911021116j7c82f3cbsf9c062626a8fff45@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

How do I use the functions to get data from sequence objects?
For example, I need to know what is the value of a serial field after
inserting a new record; the one assigned to the record just inserted.

I have tried the psql interfase with the following:
select currval('restaurant.ordenes_clave_seq');
but I get a message telling me that "currval of sequence "ordenes_clave_seq"
is not yet defined in this session.

Please advice.

Respectfully,
Jorge Maldonado

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2009-11-02 19:30:01 Re: Can't get list of databases with \list
Previous Message Christopher Frank 2009-11-02 19:13:12 Can't get list of databases with \list