diff options
-rw-r--r-- | contrib/pgfruit/pgfruit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/pgfruit/pgfruit.c b/contrib/pgfruit/pgfruit.c index 9a47611c66..06e89d8019 100644 --- a/contrib/pgfruit/pgfruit.c +++ b/contrib/pgfruit/pgfruit.c @@ -472,7 +472,11 @@ pgfruit_reread(int nhints, int *hinted_ids) UnlockDatabaseObject(RelationRelationId, RelationGetRelid(rel), 0, AccessExclusiveLock); - /* We also need a snapshot. */ + /* + * We must take a snapshot AFTER performing the lock waits above, so + * that we can be certain of seeing the changes made by any concurrent + * transactions for which we may have just waited. + */ snapshot = RegisterSnapshot(GetLatestSnapshot()); /* |