431

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; 
mateusmaso
  • 7,843
  • 6
  • 41
  • 54

1 Answers1

842

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.

mu is too short
  • 426,620
  • 70
  • 833
  • 800