Skip site navigation (1) Skip section navigation (2)

Re: Changing from NOT NULL to NULL

From: Rob Mosher <mosher(at)andrews(dot)edu>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Changing from NOT NULL to NULL
Date: 2004-02-16 16:03:05
Message-ID: 4030E9B9.6000908@andrews.edu (view raw or flat)
Thread:
Lists: pgsql-novice
I will try this out as soon as I can. Thanks to all who replied.

Rob Mosher

Tom Lane wrote:

>Rob Mosher <mosher(at)andrews(dot)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
>  
>

In response to

pgsql-novice by date

Next:From: joseph speigleDate: 2004-02-16 17:12:56
Subject: Re: PostgreSQL From xinit
Previous:From: userDate: 2004-02-16 15:29:53
Subject: Re: Createdb fails

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group