Re: How to add an INHERITS to an already populated table ? - Mailing list pgsql-general

From Zlatko Matic
Subject Re: How to add an INHERITS to an already populated table ?
Date
Msg-id 000501c565c5$5d7c5840$ba8c1dc3@zlatkovyfkpgz6
Whole thread Raw
In response to How to add an INHERITS to an already populated table ?  (David Pradier <dpradier@apartia.fr>)
List pgsql-general
Hi. Recently I have tried to do the same thing  and I coudn't include
inheritence in existing tables. After a half of day of frustration, I have
got an idea. I  have successfully done it by using EMS PostgreSQL Manager
Lite (you can download it from the net).
There is an option "Duplicate" in EMS Manager, by which you can duplicate
any table with all properties except foreign keys. During that process you
can modify code (before Commit) so you can include inheritence in your new
table. Then you delete original table, rename new table to old name and
recreate foreign key...
Well, I'm a newbie, so maybe someone more experienced offer you some better
advice. If not, this will work...
Bye.

----- Original Message -----
From: "David Pradier" <dpradier@apartia.fr>
To: <pgsql-general@postgresql.org>
Sent: Tuesday, May 31, 2005 10:10 AM
Subject: [GENERAL] How to add an INHERITS to an already populated table ?


> Hi everybody,
>
> is it possible to add some inheritance lively, without doing a
> dump/restore ?
>
> Some bits of information to explain why I'd like to do that :
> I've got those big tables, without correct constraints, sometimes even
> without foreign keys et with sometimes some problems of data corruption,
> coming from the application part.
> What I'd really like to do is to add to every important table some
> inheritance to a table we have which contains the following information :
> (created_by, modified_by, date_of_creation, date_of_modification).
> And of course, I can't stop the server.
>
> Best regards,
> David
>
> --
> dpradier@apartia.fr - tel: 01.46.47.21.33 - fax: 01.46.47.21.37
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>               http://archives.postgresql.org
>


pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: How to add an INHERITS to an already populated table
Next
From: Timothy Perrigo
Date:
Subject: pg_get_serial_sequence and table inheritence