Martijn van Oosterhout <kleptog@xxxxxxxxx> writes: > On Mon, Oct 24, 2005 at 02:42:09PM -0700, Jeff Davis wrote: >> And what about a transaction left open for 2PC? Does a transaction get a >> new XID if it's PREPAREd now and COMMIT PREPAREd in a year? > That I don't know. A prepared transaction is still open for this purpose (and for purposes such as holding locks, preventing VACUUM reclamation of tuples, etc). In practice, leaving prepared transactions hanging around will be just as socially unfriendly as opening a regular transaction and then sitting on it. > Perhaps that's why it's stops a million before overflow. No, that's to give the DBA some breathing room for recovery. He needs enough remaining transaction IDs to do database-wide vacuums (which, remember, eat an XID per table ... so it's conceivable that even a million might not be enough ...) regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend