From: | "Zlatko Matic" <zlatko(dot)matic1(at)sb(dot)t-com(dot)hr> |
---|---|
To: | "David Pradier" <dpradier(at)apartia(dot)fr>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: How to add an INHERITS to an already populated table ? |
Date: | 2005-05-31 09:44:34 |
Message-ID: | 000501c565c5$5d7c5840$ba8c1dc3@zlatkovyfkpgz6 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)apartia(dot)fr>
To: <pgsql-general(at)postgresql(dot)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(at)apartia(dot)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
>
From | Date | Subject | |
---|---|---|---|
Next Message | Timothy Perrigo | 2005-05-31 12:20:24 | pg_get_serial_sequence and table inheritence |
Previous Message | Richard Huxton | 2005-05-31 09:18:49 | Re: How to add an INHERITS to an already populated table |