Altering metadata to add inheritance

From: jboes(at)nexcerpt(dot)com (Jeff Boes)
To: pgsql-general(at)postgresql(dot)org
Subject: Altering metadata to add inheritance
Date: 2002-01-31 17:12:31
Message-ID: d40a65a1.0201310912.2bacd597@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

As an experiement, I want to turn a number of identically structured
tables into "child" tables of a template. That is, I want to do
something like:

alter table foo_01 rename to foo_01_old;
create table foo_01 () inherits (foo_template);
insert into foo_01 select * from foo_01_old;
drop table foo_01_old;

a whole lotta times, for different values of 'foo_01'. I suspect
there's a way to do this directly in the pg_class table. Does anyone
have a tried and safe approach?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim Martinez 2002-01-31 17:35:52 Re: Function to Pivot data
Previous Message Oliver Elphick 2002-01-31 17:00:37 Re: newbie 7.1.3 config question