Changing NOT NULL condition on column

From: Bob Smith <bsmith(at)h-e(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Changing NOT NULL condition on column
Date: 2003-05-20 23:40:34
Message-ID: 734BFEFD-8B1C-11D7-AAB1-0003933DD370@h-e.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


I need to change the not-null restriction on some columns in a table,
and this doesn't seem to be possible with ALTER TABLE. Is it safe to
connect as superuser and update pg_attribute.attnotnull directly? Or
is there a different way to do this, other than dropping/re-creating
the whole table?

I'm currently running 7.2.3, but will be upgrading soon so I'd like to
know if this would work with 7.3 as well.

Thanks!

Bob Smith
Hammett & Edison, Inc.
bsmith(at)h-e(dot)com

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-05-21 03:58:44 Re: Changing NOT NULL condition on column
Previous Message Kovalcik, Mike A [ITS] 2003-05-20 23:08:22 Date question....