I have a boolean column where I have added a default value of false. It is my understanding that the default value will kick in when I add new rows to the table. However, I would like a default value of false when the rows are updated as well. Is that possible?
For example:
ALTER TABLE mytable ALTER COLUMN mycolumn SET DEFAULT false;
-- In below query the mycolumn should default to false
update mytable set somecolumn = 'somevalue'
where somecolumn = 'anothervalue'
-- In below query mycolumn should be true since the value is specified
update mytable set somecolumn = 'somevalue' mycolumn = true
where somecolumn = 'anothervalue'