PostgreSQL 14: This works splendedly:
DECLARE
_context audit.etl_failed_execution_contexts;
BEGIN
snip...
INSERT INTO audit.etl_failed_execution_contexts VALUES (_context.*);
But there is a unique constraint, so I want something like:
INSERT INTO audit.etl_failed_execution_contexts
VALUES (_context.*)
ON CONFLICT (correlation_id) DO UPDATE SET (*) = ROW(_context.*);
Instead of:
INSERT INTO audit.etl_failed_execution_contexts
VALUES (_context.*)
ON CONFLICT (correlation_id) DO UPDATE SET
col1 = excluded.col1,
col2 = excluded.col2,
snip...;
Doesn't seem possible from docs, other questions on the web, but hoping anyway. Thanks.