RE: Delete coloumn

Поиск
Список
Период
Сортировка
От Grigoriy G. Vovk
Тема RE: Delete coloumn
Дата
Msg-id 20010807110112.R931-100000@callisto.internal.linustech.com.cy
обсуждение исходный текст
Ответ на RE: Delete coloumn  ("Robby Slaughter" <webmaster@robbyslaughter.com>)
Список pgsql-sql
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
Дата:
Сообщение: Are circular REFERENCES possible ?