ALTER TABLE, set null in not null column, PostgreSQL 9.1 ALTER TABLE, set null in not null column, PostgreSQL 9.1 postgresql postgresql

ALTER TABLE, set null in not null column, PostgreSQL 9.1


ALTER TABLE person ALTER COLUMN phone DROP NOT NULL;

More details in the manual: http://www.postgresql.org/docs/9.1/static/sql-altertable.html


Execute the command in this format

ALTER TABLE tablename ALTER COLUMN columnname SET NOT NULL;

for setting the column to not null.


First, Set :ALTER TABLE person ALTER COLUMN phone DROP NOT NULL;