Moving existing tables into an inheritence hierarchy

From: s anwar <sanwar(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Moving existing tables into an inheritence hierarchy
Date: 2006-01-18 21:12:13
Message-ID: 3e3c86f90601181312n1aa86aabn7c1f912db090c7d6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Good Day:

I have a couple hundred tables t1,t2,...tN that I are free standing. I would
like to make them members of a partitioned table t, via inheritence. All the
tables have the same layout/format. The method that I am currently using is
as follows:

create table x1(check(part=1)) inherits(t);
insert into x1 select * from t1;
drop table t1;
alter table x1 rename to t1;

It works fine, except that it is quite slow. Is there a way of just updating
"pg_inherits" and some other table such that postgres is happy without
actually doing the inserts?

Thanks.

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2006-01-18 21:28:02 Re: Swappng Filds
Previous Message Michael Fuhr 2006-01-18 21:10:16 Re: Huge size of Data directory