Re: Adding constraint

From: "Cornelia Boenigk" <poppcorn(at)cornelia-boenigk(dot)de>
To: "Patrick Nelson" <pnelson(at)neatech(dot)com>, "PostgreSQL List (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Adding constraint
Date: 2002-10-21 01:05:26
Message-ID: E183Qzw-0004B1-00@mrelayng0.kundenserver.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-10-21 01:13:29 Re: Buffers and MacOS X
Previous Message Tom Lane 2002-10-21 00:48:31 Re: Buffers and MacOS X