Ensure get_pg_settings() returns false if parameter not found

Previously, if e.g. a non-superuser connection is used to get a value
like `data_directory`, which is available to superusers only, it
would return true.
This commit is contained in:
Ian Barwick
2016-09-19 14:04:21 +09:00
parent 178b380f34
commit 3ce231a571
2 changed files with 2 additions and 2 deletions

View File

@@ -504,7 +504,7 @@ get_pg_setting(PGconn *conn, const char *setting, char *output)
char sqlquery[QUERY_STR_LEN];
PGresult *res;
int i;
bool success = true;
bool success = false;
sqlquery_snprintf(sqlquery,
"SELECT name, setting "

View File

@@ -3697,7 +3697,7 @@ do_standby_switchover(void)
/* the remote server is the primary to be demoted */
char remote_conninfo[MAXCONNINFO] = "";
char remote_host[MAXLEN];
char remote_data_directory[MAXLEN];
char remote_data_directory[MAXPGPATH] = "";
int remote_node_id;
char remote_node_replication_state[MAXLEN] = "";
char remote_archive_config_dir[MAXLEN];