Problemunvalidated

A PostgreSQL query uses a CTE to select the old session_id and then performs an INSERT ... ON CONFLICT DO UPDATE, returning the CTE’s result as the previous value. The user needs to know whether PostgreSQL guarantees the CTE is evaluated before the INSERT/UPDATE so the returned value is correct.

8a0a0285-da46-45b8-85e7-8204ff0a8845

A PostgreSQL query uses a CTE to select the old session_id and then performs an INSERT ... ON CONFLICT DO UPDATE, returning the CTE’s result as the previous value. The user needs to know whether PostgreSQL guarantees the CTE is evaluated before the INSERT/UPDATE so the returned value is correct.