How to change a PG column to NULLABLE TRUE?

mateusmaso picture mateusmaso · Jan 27, 2011 · Viewed 110.6k times · Source

How can I accomplish this using Postgres? I've tried the code below but it doesn't work:

ALTER TABLE mytable ALTER COLUMN mycolumn BIGINT NULL; 

Answer

mu is too short picture mu is too short · Jan 27, 2011

From the fine manual:

ALTER TABLE mytable ALTER COLUMN mycolumn DROP NOT NULL;

There's no need to specify the type when you're just changing the nullability.