Thanks all for your comments. Just another little hint here (sorry for trivial questions): if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))) { if (tuple->t_infomask & HEAP_IS_LOCKED) return true; if (HeapTupleHeaderGetCmax(tuple) >= GetCurrentCommandId()) return true; /* deleted after scan started */ else return false; /* deleted before scan started */ } what does that "deleted after scan started" means? How is possible that the current transaction has deleted the tuple with a command higher than the one that is still executing? An example could clearify.... Thanks, Luca ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster