set default schema when connecting

This commit is contained in:
Matthew Bucci
2024-10-18 23:13:25 -07:00
parent 36726124a4
commit 3af0cc5f51

View File

@ -105,6 +105,9 @@ function wpsqli_real_connect(&$connection, $hostname = null, $username = null, $
$pg_connstr = $GLOBALS['pg4wp_connstr'] . ' dbname=' . $dbname;
$GLOBALS['pg4wp_conn'] = $connection = pg_connect($pg_connstr);
// Set the default schema
pg_query($connection, 'SET search_path TO ' . pg_escape_literal(DB_SCHEMA));
return $connection;
}