Martijn van Oosterhout <kleptog@xxxxxxxxx> writes: > Why not just do it in a single transaction? I don't think you need to > use SERIALIZABLE at all, I think normal read-committed mode will do > what you want, no? > BEGIN; > INSERT INTO archive (...) SELECT ... FROM active WHERE user_id = ...; > DELETE FROM active WHERE user_id = ...; > COMMIT; No, that's exactly wrong: in read-committed mode the DELETE could delete rows that were not seen by the SELECT. It would work in serializable mode though. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html