Re: alter table drop column status

From: Jean-Michel POURE <jm(dot)poure(at)freesurf(dot)fr>
To: Kovacs Zoltan <kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu>, Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, dpage(at)pgadmin(dot)org
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: alter table drop column status
Date: 2002-02-14 09:16:32
Message-ID: 200202140916.g1E9GXL09930@www1.translationforge
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le Mercredi 13 Février 2002 18:23, Kovacs Zoltan a écrit :
> I wanted to know if I should wait for the solution of the full ALTER TABLE
> implementation or not. I'm afraid I shouldn't wait, should I? ;-)

What we could do using pgAdmin2 is :
("table_from" is the table to be modified, "table_to" is the resulting table)

1) Mark objects for deletion
* mark columns in "table_from" for deletion,
* mark primary keys in "table_from" for deletion,
* mark foreign keys in "table_from" for deletion,

2) Copy schema and data
* copy "table_to" structure out of "table_from" keeing only marked objects,
* copy data from "table_from" to "table_to",

3) Add rules and triggers, rename
* add "table_from" triggers to "table_to",
* add "table_from" rules to "table_to",
* drop table "table_from",
* rename "table_to".

The same script should also work for inherited tables.

This could be a hack until equivalent features are added natively to
PostgreSQL. Do you think it is relevant to add this feature to pgAdmin2? Does
Hiroshi script provide the same kind of features?

What is your opinion my dear friends? We wait for your advice.

Cheers,
jean-Michel POURE

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Copeland 2002-02-14 14:00:58 Re: NAMEDATALEN Changes
Previous Message Neil Conway 2002-02-14 05:59:40 Re: NAMEDATALEN Changes