From 1cac62dac0cfdcacdb2c2b1577dadf101ef7f1f4 Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Sun, 5 Nov 2017 09:25:52 -0800 Subject: Ignore CatalogSnapshot when checking COPY FREEZE prerequisites. This restores the ability, essentially lost in commit ffaa44cb559db332baeee7d25dedd74a61974203, to use COPY FREEZE under REPEATABLE READ isolation. Back-patch to 9.4, like that commit. Reviewed by Tom Lane. Discussion: https://postgr.es/m/CA+TgmoahWDm-7fperBxzU9uZ99LPMUmEpSXLTw9TmrOgzwnORw@mail.gmail.com --- src/backend/utils/time/snapmgr.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/backend/utils/time/snapmgr.c') diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time/snapmgr.c index de6441b2701..8e19c99806e 100644 --- a/src/backend/utils/time/snapmgr.c +++ b/src/backend/utils/time/snapmgr.c @@ -1599,6 +1599,14 @@ DeleteAllExportedSnapshotFiles(void) FreeDir(s_dir); } +/* + * ThereAreNoPriorRegisteredSnapshots + * Is the registered snapshot count less than or equal to one? + * + * Don't use this to settle important decisions. While zero registrations and + * no ActiveSnapshot would confirm a certain idleness, the system makes no + * guarantees about the significance of one registered snapshot. + */ bool ThereAreNoPriorRegisteredSnapshots(void) { -- cgit v1.2.3