1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-17 01:12:23 +02:00

Set search_path = 'pg_catalog' on PostgreSQL connections.

Suggested by Stephen Frost.
This commit is contained in:
David Steele
2018-06-21 11:39:37 -04:00
parent 7fee739710
commit aa41e00c9c
3 changed files with 20 additions and 0 deletions

View File

@ -210,10 +210,15 @@ sub connect
if ($fDbVersion >= PG_VERSION_APPLICATION_NAME)
{
# Set application name for monitoring and debugging
$self->{hDb}->do(
"set application_name = '" . BACKREST_NAME . ' [' .
(cfgOptionValid(CFGOPT_COMMAND) ? cfgOption(CFGOPT_COMMAND) : cfgCommandName(cfgCommandGet())) . "]'")
or confess &log(ERROR, $self->{hDb}->errstr, ERROR_DB_QUERY);
# Clear search path to prevent possible function overrides
$self->{hDb}->do("set search_path = 'pg_catalog'")
or confess &log(ERROR, $self->{hDb}->errstr, ERROR_DB_QUERY);
}
}
}