Re: Increasing Table Column Size in 7.0 Syntax - Mailing list pgsql-general

From Marc SCHAEFER
Subject Re: Increasing Table Column Size in 7.0 Syntax
Date
Msg-id Pine.LNX.3.96.1001101201256.829B-100000@defian.alphanet.ch
Whole thread Raw
In response to Re: Increasing Table Column Size in 7.0 Syntax  (Richard Poole <richard.poole@vi.net>)
List 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 by date:

Previous
From: "Nick Fankhauser"
Date:
Subject: RE: Sample Program
Next
From: Chris Jones
Date:
Subject: database synchronization