<?php

namespace Emergence\Database;

use PDO;

class PostgresConnection extends AbstractSqlConnection
{
    protected static $defaultInstance;

    public static function createInstance($pdo = null)
    {
        $pdo = $pdo ?: [];

        if (is_array($pdo)) {
            $dsn = 'pgsql:options=\'--client_encoding=UTF8\';dbname=' . $pdo['database'];

            $dsn .= ';host=' . ($pdo['host'] ?: 'localhost');
            $dsn .= ';port=' . ($pdo['port'] ?: 5432);

            if (!empty($pdo['application_name'])) {
                $dsn .= ';application_name=' . $pdo['application_name'];
            }

            $pdo = new PDO($dsn, $pdo['username'], $pdo['password']);
        }

        return parent::createInstance($pdo);
    }
}
<?php

namespace Emergence\Database;

use PDO;

class PostgresConnection extends AbstractSqlConnection
{
    protected static $defaultInstance;

    public static function createInstance($pdo = null)
    {
        $pdo = $pdo ?: [];

        if (is_array($pdo)) {
            $pdoConfig = $pdo;

            $dsn = 'pgsql:options=\'--client_encoding=UTF8\';dbname=' . $pdoConfig['database'];

            $dsn .= ';host=' . ($pdoConfig['host'] ?: 'localhost');
            $dsn .= ';port=' . ($pdoConfig['port'] ?: 5432);

            if (!empty($pdoConfig['application_name'])) {
                $dsn .= ';application_name=' . $pdoConfig['application_name'];
            }

            $pdo = new PDO($dsn, $pdoConfig['username'], $pdoConfig['password']);

            if (!empty($pdoConfig['search_path'])) {
                $pdo->query('SET search_path = "'.implode('","', $pdoConfig['search_path']).'"')->closeCursor();
            }
        }

        return parent::createInstance($pdo);
    }
}
Enable setting postgres search_path from site.json config
Enable setting postgres search_path from site.json config
