reg_pg_stefanz@xxxxxxxxxxxxx writes: > it run into an issue with: ERROR: no known snapshots Hi! This has been reported before, but I'm embarrassed to say that the previous report seems to have fallen between the cracks. I've created a patch [1] that resolves your example as presented. If you're in a position to apply the patch and see if it resolves your real non-simplified case, that would be very helpful. Also, this fix in principle will create a small performance penalty for FOR-loops in non-atomic contexts such as DO loops. It'd be interesting to know if the penalty is noticeable in your usage. regards, tom lane [1] https://www.postgresql.org/message-id/1032535.1620789957%40sss.pgh.pa.us