I want to create a NOT NULL column in my table with values from an other column as default values. How I can do that?
ALTER TABLE mytable
ADD COLUMN not_null_column TIME WITHOUT TIME ZONE NOT NULL DEFAULT old_column
but that not works because old_column is not constant
Any idea?
ALTER TABLE mytable ADD COLUMN not_null_column TIME WITHOUT TIME ZONE NOT NULL DEFAULT NOW(); UPDATE mytable SET not_null_column=old_column;