Re: Changing from NOT NULL to NULL - Mailing list pgsql-novice

From Tom Lane
Subject Re: Changing from NOT NULL to NULL
Date
Msg-id 16118.1076886507@sss.pgh.pa.us
Whole thread Raw
In response to Changing from NOT NULL to NULL  (Rob Mosher <mosher@andrews.edu>)
Responses Re: Changing from NOT NULL to NULL
List pgsql-novice
Rob Mosher <mosher@andrews.edu> writes:
> Is there anyway I can change a field to allowing nulls without dumping
> the table, dropping it, recreating it as desired, and filling all the
> data back in?

ALTER TABLE ... DROP NOT NULL does the trick in recent releases.  Before
that, you could resort to manually poking the attnotnull flag in
the pg_attribute row for the field.

            regards, tom lane

pgsql-novice by date:

Previous
From: Nabil Sayegh
Date:
Subject: Re: Changing from NOT NULL to NULL
Next
From: "V i s h a l Kashyap @ [Sai Hertz And Control Systems]"
Date:
Subject: PostgreSQL From xinit