Commit 54f4cb26 authored by Rack Lin's avatar Rack Lin

Added support PostgreSQL schema setting, if schema has been specified.

Signed-off-by: 's avatarRack Lin <racklin@gmail.com>
parent ec418362
...@@ -85,6 +85,7 @@ return array( ...@@ -85,6 +85,7 @@ return array(
'password' => '', 'password' => '',
'charset' => 'utf8', 'charset' => 'utf8',
'prefix' => '', 'prefix' => '',
'schema' => 'public',
), ),
'sqlsrv' => array( 'sqlsrv' => array(
......
...@@ -44,6 +44,13 @@ class Postgres extends Connector { ...@@ -44,6 +44,13 @@ class Postgres extends Connector {
$connection->prepare("SET NAMES '{$config['charset']}'")->execute(); $connection->prepare("SET NAMES '{$config['charset']}'")->execute();
} }
// If a schema has been specified, we'll execute a query against
// the database to set the search path.
if (isset($config['schema']))
{
$connection->prepare("SET search_path TO '{$config['schema']}'")->execute();
}
return $connection; return $connection;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment