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@xxxxxxxxxx>
To: <pgsql-general@xxxxxxxxxxxxxx>
Sent: Tuesday, May 31, 2005 10:10 AM
Subject: 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@xxxxxxxxxx - 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
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster