Thread: from not null field to nullable field?

from not null field to nullable field?

From
Carolyn Lu Wong
Date:
I have a field in a table that has been defined 'not null'. Is it
possible to remove this constraint? I don't see this option under 'alter
table'.


Re: from not null field to nullable field?

From
Wim Ceulemans
Date:
Carolyn Lu Wong wrote:
> 
> I have a field in a table that has been defined 'not null'. Is it
> possible to remove this constraint? I don't see this option under 'alter
> table'.

update pg_attribute set attnotnull = 'f' where oid = oidofnotnullcolumn;
vacuum analyze;

Regards
Wim