From 3af0cc5f51dc2f90cb3d9f6f3ae3c878d8fdd08c Mon Sep 17 00:00:00 2001 From: Matthew Bucci Date: Fri, 18 Oct 2024 23:13:25 -0700 Subject: [PATCH] set default schema when connecting --- pg4wp/driver_pgsql.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index ac83d76..b44af89 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -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; }