▲ | tudorg a day ago | |||||||
That is correct, for non-volatile default values Postgres is quick, which means that it is generally a safe operation. Also interesting, `now()` is non-volatile because it's defined as "start of the transaction". So if you add a column with `DEFAULT now()` all rows will get the same value. But `timeofday()` is not volatile, so `DEFAULT timeofday()` is going to lock the table for a long time. A bit of a subtle gotcha. | ||||||||
▲ | avg_dev a day ago | parent [-] | |||||||
Thanks for the info. One minor point: > But `timeofday()` is not volatile, so `DEFAULT timeofday()` is going to lock the table for a long time. Perhaps the “not” was a typo? | ||||||||
|