deduce sequence name from table and column - Mailing list pgsql-general

From Louis-David Mitterrand
Subject deduce sequence name from table and column
Date
Msg-id 20051220150453.GA26818@apartia.fr
Whole thread Raw
Responses Re: deduce sequence name from table and column
List pgsql-general
Hi,

Is there a way (from DBI) to deduce a sequence name from the table and
column it is attached to?

For instance:

  Column    |  Type   |                                Modifiers
-------------+---------+--------------------------------------------------------------------------
 id_fonction | integer | not null default nextval(('"fonction_id_fonction_seq"'::text)::regclass)

I'd like to be able to programmatically find "fonction_id_fonction_seq"
so that I can then call nextval() on it.

Thanks,

--
Only half the people in the world are above average intelligence.

pgsql-general by date:

Previous
From: Henrique Engelmann
Date:
Subject: Could not read - Permission denied
Next
From: Tom Lane
Date:
Subject: Re: deduce sequence name from table and column