Modifying existing tables - Mailing list pgsql-admin

From Steve Doerr
Subject Modifying existing tables
Date
Msg-id 3B6A1C81.2D9D4E70@swbell.net
Whole thread Raw
List pgsql-admin
Is this the only way to add attributes to an existing table, and add
unique and a default(for example) to existing attributes?

Just wondered if there are alternatives.  I didn't really see this in
the docs or mailing lists.

Thanks for any input.
Steve

original table:
CREATE TABLE table (
    attrib1 int,
    attrib2 int,
);


table edit:
CREATE TABLE newtable (
    attrib1 int UNIQUE,
    attrib2 int DEFAULT 1,
    attrib3 int
);

INSERT INTO newtable (attrib1, attrib2)
SELECT attrib1, attrib2 FROM table;

DROP TABLE table;
ALTER TABLE newtable RENAME TO table;



pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Memory exhausted errors
Next
From: "Jason"
Date:
Subject: A replication like process