alter table change type of column not null postgresql code example
Example 1: postgresql change column to not null
-- To change a column to NOT NULL:
ALTER TABLE products ALTER COLUMN product_no SET NOT NULL;
Example 2: postgresql alter column nullable
-- To change a column to nullable
ALTER TABLE mytable ALTER COLUMN mycolumn DROP NOT NULL;