Adding constraint

From: Patrick Nelson <pnelson(at)neatech(dot)com>
To: "PostgreSQL List (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Adding constraint
Date: 2002-10-21 00:01:55
Message-ID: 4165C48DE9A0D211B6400800095C585F172E79@WASHINGTON
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I added a column to a table with
ALTER TABLE company ADD varchar(8);

I had really wanted to have this set to not null but now I can't figure out
how to do that. At first I thought that I could just drop the column... OK
that doesn't seem to be the way.

There is a fair amount of data in the tables and I could dump them and
rebuild it, but I just get the feeling that there is a easier way. Am I
mad? So here are the questions:

Can you alter a table and drop a column?

Can you add 'not null' to an existing column?

Or... I don't know... is there a better way?

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-10-21 00:48:31 Re: Buffers and MacOS X
Previous Message Hunter Hillegas 2002-10-20 19:05:04 Buffers and MacOS X