Re: Adding constraint - Mailing list pgsql-general

From Cornelia Boenigk
Subject Re: Adding constraint
Date
Msg-id E183Qzw-0004B1-00@mrelayng0.kundenserver.de
Whole thread Raw
In response to Adding constraint  (Patrick Nelson <pnelson@neatech.com>)
List pgsql-general
Hi Patrick

> Can you alter a table and drop a column?
Not with an ALTER TABLE statement. You have to create a new table without
this column, fill it with the existing data, drop the original table and
rename the newly created table to the original name.

CREATE TABLE newname AS SELECT <fieldlist> FROM originaltable ...
creates and fills a new table with the results of a SELECT.

> Can you add 'not null' to an existing column?
The 7.2 Documentation says:
In the current implementation of ADD COLUMN, default and NOT NULL clauses
for the new column are not supported.

Regards
Conni





pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Buffers and MacOS X
Next
From: Bruce Momjian
Date:
Subject: Re: Buffers and MacOS X