You cannot do that. You can use an expression there or the DEFAULT
keyword.
SET { column = { expression | DEFAULT } | ... }
However, you can split your query into 2 updates:
UPDATE some_table
SET some_column = DEFAULT
WHERE id = 1 AND some_condition;
UPDATE some_table
SET some_column = 'foo'
WHERE id = 1 AND NOT some_condition;
This will do the desired changes. If you really want to do it in one query, you can use CTEs:
WITH upd1 AS (
UPDATE some_table
SET some_column = DEFAULT
WHERE id = 1 AND some_condition
RETURNING *
),
upd2 AS (
UPDATE some_table
SET some_column = 'foo'
WHERE id = 1
RETURNING *
)
SELECT * FROM upd1
UNION ALL
SELECT * FROM upd2
Note: the AND NOT some_condition
skipped intentionally. The last CTE can work exactly as the ELSE
branch in the CASE
expression, because if you use multiple data modifying CTEs, maximum one of them can affect every row within a table.