I have column of tstzrange
type (timestamp with time zone range) and I need to update only upper or lower bound of this value (and keep inclusive/exclusive boundari
I found function I missed, it's possible to do that like this
UPDATE table
SET
my_column = tstzrange(
lower(my_column),
now(),
concat(
CASE WHEN lower_inc(my_column) THEN '[' ELSE '(' END,
CASE WHEN upper_inc(my_column) THEN ']' ELSE ')' END
)
)
It would be better to create function for this probably. Or is there any other (simpler/better) solution?