RE: Delete coloumn

Поиск
Список
Период
Сортировка
Искать
От
Grigoriy G. Vovk
Тема
RE: Delete coloumn
Дата
Msg-id
20010807110112.R931-100000@callisto.internal.linustech.com.cy
Ответ на
RE: Delete coloumn (Robby Slaughter)
Список
Дерево обсуждения
Delete coloumn "Suhadi" <suhadi@indosatcom.net>
RE: Delete coloumn "Robby Slaughter" <webmaster@robbyslaughter.com>
RE: Delete coloumn "Grigoriy G. Vovk" <grigoriy.vovk@linustech.com.cy>
Re: Delete coloumn Grant <grant@conprojan.com.au>
Re: Delete coloumn Grant <grant@conprojan.com.au>
Aug 6, 23:35 -0500, Robby Slaughter wrote:

> SELECT INTO it. Example:
>
> CREATE TABLE sample (
>   id   INTEGER,
>   data TEXT,
>   badcolumn DATE );
>
> Now to delete the bad column table:
>
> CREATE TABLE sample_copy (
>   id  INTEGER,
>   data TEXT);
>
> and then copy it all over:
>
> SELECT id,data INTO sample_copy FROM sample;

It is not correct. This statement used to _create_ _new_ table.
Correct is:
insert into sample_copy select id, data from sample;

>
> and then you can DROP TABLE sample;
>
> If you need the original table name, repeat the process of
> creating a new table now and copying the data over.
>
> Hope that helps!
>
> -Robby Slaughter

my best regards,
----------------
Grigoriy G. Vovk


В списке pgsql-sql по дате отправления
От: Stephan Szabo
Дата:
Сообщение: Re: Delete Trigger Issue
От: Denis Bucher
Дата:
FAQ