pg_get_serial_sequence and table inheritence

From: Timothy Perrigo <tperrigo(at)wernervas(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: pg_get_serial_sequence and table inheritence
Date: 2005-05-31 12:20:24
Message-ID: 1459CCC1-5847-4E3B-82CC-11D4B94698F1@wernervas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is there anything similar to pg_get_serial_sequence that will work
with tables that have an inherited serial column? For example, if I
have 2 tables:

create table base (
id serial not null primary key
);

and

create table derived (
stuff text,
constraint derived_pkey primary key(id)
) inherits (base);

I'd like to be able to call pg_get_serial_sequence passing "derived"
for the table and "id" for the sequence column (to get, in this case
"base_id_seq"). If nothing like this currently exists, any
suggestions on how I could write a plpgsql function to get this
behavior?

Thank you for any suggestions!
Tim

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2005-05-31 12:33:39 Re: How to add an INHERITS to an already populated table
Previous Message Zlatko Matic 2005-05-31 09:44:34 Re: How to add an INHERITS to an already populated table ?