Kevin Heflin wrote:

> I've been looking through the online docs, so far have not found this
> information.
>
> After an INSERT, I want to retrieve the value of the sequence I use for
> unique_ids
>
> Any suggestions ?

Use the OID returned from the INSERT to select the newly created value,
i.e.,

    insert into mytable (stuff...) ...
    select id from mytable where oid = NNNN...

How to get the OID in the first example varies depending on your interface
(perl/DBI, PL/pgsql, etc).

Alternatively, use the currval(mytable_id_seq) function within the same
session immediately after the insert.

Cheers.
Ed



************

Reply via email to