Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pgconfigure
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
rm -rf postgres
mkdir postgres
curl -s -v --retry 5 -L https://github.com/postgres/postgres/archive/refs/tags/REL_15_2.tar.gz | tar xz --strip-components 1 -C postgres
curl -s --retry 5 -L https://github.com/postgres/postgres/archive/refs/tags/REL_15_2.tar.gz | tar xz --strip-components 1 -C postgres

if [ "$OS" = "Windows_NT" ]; then
(cd postgres/src/tools/msvc/ && perl mkvcbuild.pl)
Expand Down
10 changes: 4 additions & 6 deletions src/postgres_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,12 @@ static void PostgresGetSnapshot(PostgresVersion version, const PostgresBindData
return;
}

// As of PostgreSQL 10.0 (right after 9.6), synchronous snapshots
// are allowed on replicas. (https://www.postgresql.org/docs/release/10.0/)
result =
con.TryQuery("SELECT pg_is_in_recovery(), pg_export_snapshot(), (select count(*) from pg_stat_wal_receiver)");
con.TryQuery("SELECT pg_export_snapshot()");
if (result) {
auto in_recovery = result->GetBool(0, 0) || result->GetInt64(0, 2) > 0;
gstate.snapshot = "";
if (!in_recovery) {
gstate.snapshot = result->GetString(0, 1);
}
gstate.snapshot = result->GetString(0, 0);
return;
}
}
Expand Down