Re: alter table drop column status

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <jm(dot)poure(at)freesurf(dot)fr>, "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: "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-15 01:01:53
Message-ID: GNELIHDDFBOCMGBFGEFOOEGICBAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

That's the only way to do it at the moment - would you like to collaborate
on the actual sql script to get this done? I wonder if it could be done
entirely with a stored procedure? That'd be cool:

select drop_column(mytable, mycolumn);

Sweet :)

I'd like to implement this for phpPgAdmin as well.

Chris

> -----Original Message-----
> From: Jean-Michel POURE [mailto:jm(dot)poure(at)freesurf(dot)fr]
> Sent: Thursday, 14 February 2002 5:17 PM
> To: Kovacs Zoltan; Hiroshi Inoue; dpage(at)pgadmin(dot)org
> Cc: Christopher Kings-Lynne; Tom Lane; pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [HACKERS] alter table drop column status
>
>
> 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 Christopher Kings-Lynne 2002-02-15 01:59:29 SET NULL / SET NOT NULL
Previous Message Tom Lane 2002-02-15 00:54:36 Re: Strange problem when upgrading to 7.2 with pg_upgrade.