Re: Increasing Table Column Size in 7.0 Syntax

Поиск
Список
Период
Сортировка
От Marc SCHAEFER
Тема Re: Increasing Table Column Size in 7.0 Syntax
Дата
Msg-id Pine.LNX.3.96.1001101201256.829B-100000@defian.alphanet.ch
обсуждение исходный текст
Ответ на Re: Increasing Table Column Size in 7.0 Syntax  (Richard Poole <richard.poole@vi.net>)
Список pgsql-general
On Wed, 1 Nov 2000, Richard Poole wrote:

> Long answer: create a new table with the same columns, except give the
> one you want to change its new size. Then copy all the data across

I just did it (for another reason)

To alter a table (remove, or change columns)

     # Copy the data
     CREATE TABLE temp AS SELECT * FROM distributors;

     # Drop and recreate the table
     DROP TABLE distributors;
     CREATE TABLE distributors (did      DECIMAL(3)  DEFAULT 1,
                                name     VARCHAR(40) NOT NULL);

     # Get back the data
     INSERT INTO distributors SELECT * FROM temp;

     # Drop the temporary table.
     DROP TABLE temp;



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

Предыдущее
От: "Nick Fankhauser"
Дата:
Сообщение: RE: Sample Program
Следующее
От: Chris Jones
Дата:
Сообщение: database synchronization