You've already forked pgbackrest
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:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user