Getting name of sequence for a table - Mailing list pgadmin-hackers

From Nicolas Ribot
Subject Getting name of sequence for a table
Date
Msg-id 200203150920.g2F9KYQ28851@cnes.fr
Whole thread Raw
List pgadmin-hackers
Hello,

I was wondering if it is possible to get the name of sequences created
for a table by an SQL query ?

Ex: I have a parcel table, with a sequence created on it for the PK
column.
A java program, that doesn't know this sequence name needs  to retrieve
the unique ID of the object recently inserted into the parcel table.
I would like to do something like
select currval( (select seqname from pg_xxx where table_name='parcel')
).

I looked at the pg_class system table and see both my table and its
sequence, but do not find a way to join them in a query.

Thanx for any help.

Nicolas Ribot
SCOT
nri@scot.cnes.fr


pgadmin-hackers by date:

Previous
From: rose.coil@msa.hinet.net
Date:
Subject:
Next
From: "frank_lupo@email.it"
Date:
Subject: upgrade wizard proxy connection