I want to add a DEFAULT
for a timestamp column in PostgreSQL. With SQL Server you use ALTER TABLE ADD CONSTRAINT
You can see the example in their docs,
ALTER TABLE dbo.doc_exz
ADD CONSTRAINT col_b_def
DEFAULT 50 FOR column_b;
In my case, I'm trying the same pattern,
ALTER TABLE foo
ADD CONSTRAINT column_name
DEFAULT now() FOR bar;
This doesn't work. What is the proper way to add a DEFAULT
for a column in PostgreSQL?