aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_basebackup/streamutil.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index 296b1888aad..1438f368edc 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -209,8 +209,13 @@ GetConnection(void)
if (conn_opts)
PQconninfoFree(conn_opts);
- /* Set always-secure search path, so malicious users can't get control. */
- if (dbname != NULL)
+ /*
+ * Set always-secure search path, so malicious users can't get control.
+ * The capacity to run normal SQL queries was added in PostgreSQL
+ * 10, so the search path cannot be changed (by us or attackers) on
+ * earlier versions.
+ */
+ if (dbname != NULL && PQserverVersion(conn) >= 100000)
{
PGresult *res;