The combination of these two statements in a transaction hits an Assert in heapam.c at line 4770 on REL_14_STABLE
BEGIN; SELECT * FROM queue LIMIT 1 FOR UPDATE SKIP LOCKED; ... UPDATE queue SET status = 'UPDATED' WHERE id = :id; COMMIT; pgbench reliably finds this, running from inside a PL/pgSQL function. Alvaro suggests we just ignore the Assert, which on testing appears to be the right approach. Patch attached, which solves it for me. There is no formal test that does lock then update, so I have attempted to create one, but this has not successfully reproduced it (attached anyway), but this code is different from the pgbench test. -- Simon Riggs http://www.EnterpriseDB.com/
skip_locked_assert.v1.patch
Description: Binary data
skip_locked_then_update_test.v1.patch
Description: Binary data