mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-03 14:54:01 +01:00
Add support for PostgreSQL schemas in DSN (#6150)
If schema is set in the dsn, set search_path to the schema value. Example: $config['db_dsnw'] = 'pgsql://user:pass@localhost/dbname?schema=exampleschema';
This commit is contained in:
committed by
Aleksander Machniak
parent
59a63c95a4
commit
edeb5d7ab4
@@ -56,6 +56,11 @@ class rcube_db_pgsql extends rcube_db
|
||||
{
|
||||
$dbh->query("SET NAMES 'utf8'");
|
||||
$dbh->query("SET DATESTYLE TO ISO");
|
||||
|
||||
// if ?schema= is set in dsn, set the search_path
|
||||
if ($dsn['schema']) {
|
||||
$dbh->query("SET search_path TO " . $this->quote($dsn['schema']));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user