Re: delete column

Поиск
Список
Период
Сортировка
От Hillensbeck, Preston
Тема Re: delete column
Дата
Msg-id 040AE3A029B3D51181D000508BC75D02013877E6@MERCURY
обсуждение исходный текст
Ответ на delete column  (webmaster <webmaster@harbornet.com>)
Ответы Re: delete column  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: delete column  (Mathieu Arnold <mat@mat.cc>)
Re: delete column  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-general
There isn't a DROP COLUMN function yet, but you can 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;

This is straight out of Bruce Momjian's book, so you can give him credit for
this :)


-----Original Message-----
From: webmaster [mailto:webmaster@harbornet.com]
Sent: Friday, April 26, 2002 7:51 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] delete column


I know this is an easy question, but I can't find any info on how do
this in the PostgreSQL book.  How do you delete a column?  I've been
able to delete tables, db's, rows, etc.  But can't figure out how to
just delete a column.  I'm running RedHat 7.2 and PostgreSQL 7.1

Thanks for any help.


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

В списке pgsql-general по дате отправления:

Предыдущее
От: webmaster
Дата:
Сообщение: delete column
Следующее
От: wsheldah@lexmark.com
Дата:
Сообщение: Re: delete column