Обсуждение: drop column?

Поиск
Список
Период
Сортировка

drop column?

От
Andrew Gould
Дата:
How do you drop a column from a table?  I'm using
PostgreSQL 7.0.2.

Thanks,

Andrew Gould

__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

Re: drop column?

От
"Adam Lang"
Дата:
Create a new table and select insert from the old one to the new one without
the column of data.

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
----- Original Message -----
From: "Andrew Gould" <andrewgould@yahoo.com>
To: <pgsql-general@postgresql.org>
Sent: Wednesday, October 04, 2000 10:39 AM
Subject: [GENERAL] drop column?


> How do you drop a column from a table?  I'm using
> PostgreSQL 7.0.2.
>
> Thanks,
>
> Andrew Gould
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
> http://photos.yahoo.com/


Re: drop column?

От
"Jason C. Wells"
Дата:
On Wed, 4 Oct 2000, Andrew Gould wrote:

> How do you drop a column from a table?  I'm using
> PostgreSQL 7.0.2.

From the FAQ.

4.5) How do you remove a column from a table?

   We do not support ALTER TABLE DROP COLUMN, but do this:
        SELECT ...  -- select all columns but the one you want to remove
        INTO TABLE new_table
        FROM old_table;
        DROP TABLE old_table;
        ALTER TABLE new_table RENAME TO old_table;

Thank you,
Jason C. Wells


Re: drop column?

От
"Poul L. Christiansen"
Дата:
You don't :)

Currently you can't drop an column from a table, but I think you can in
version 7.1. So you have to wait to november. In the mean time, just
rename it.

Andrew Gould wrote:
>
> How do you drop a column from a table?  I'm using
> PostgreSQL 7.0.2.
>
> Thanks,
>
> Andrew Gould
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
> http://photos.yahoo.com/