I want to create default timestamp column in an existing table.
My first query is
"ALTER TABLE {table_name} ADD COLUMN modifiedDate timestamp without time zone"
This works and successfully adds the column.
However the second query
ALTER TABLE {table_name} ALTER modifiedDate SET DEFAULT '2001-01-01 00:00:00'::timestamp without time zone;
fails to update all the rows on the column to contain that timestamp.
I was following this SO post.
I also tried in one query
"ALTER TABLE {table_name} ADD COLUMN modifiedDate timestamp without time zone" SET DEFAULT '2001-01-01 00:00:00'::timestamp without time zone;
but that gave an error syntax error at or near "00"