On Thu, Jul 28, 2016 at 7:29 PM, Andres Freund <and...@anarazel.de> wrote: > I think just iterating through the active snapshots would have been > fine. Afaics there's no guarantee that the first active snapshot pushed > is the relevant one - in contrast to registered one, which are ordered > by virtue of the heap.
I think the oldest snapshot has to be on the bottom of the stack; how not? >> > Hm. Could we perhaps assert that the session has a valid xmin? >> >> I don't think so. CLUSTER? > > That should have one during any toast lookups afaics - the relevant code > is > /* Start a new transaction for each relation. */ > StartTransactionCommand(); > /* functions in indexes may want a snapshot set */ > PushActiveSnapshot(GetTransactionSnapshot()); > /* Do the job. */ > cluster_rel(rvtc->tableOid, rvtc->indexOid, true, > stmt->verbose); > PopActiveSnapshot(); > CommitTransactionCommand(); > right? And > Snapshot > GetSnapshotData(Snapshot snapshot) > { > ... > > if (!TransactionIdIsValid(MyPgXact->xmin)) > MyPgXact->xmin = TransactionXmin = xmin; > sets xmin. Hmm, OK, I'll have to check on that. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers