diff --git a/src/CakeAdapter.php b/src/CakeAdapter.php index a837a62a..23fba255 100644 --- a/src/CakeAdapter.php +++ b/src/CakeAdapter.php @@ -59,8 +59,9 @@ public function __construct(AdapterInterface $adapter, ?Connection $connection = if ($connection->getDriver() instanceof Postgres) { $config = $connection->config(); - $schema = empty($config['schema']) ? 'public' : $config['schema']; - $pdo->exec('SET search_path TO ' . $pdo->quote($schema)); + if (!empty($config['schema'])) { + $pdo->exec('SET search_path TO ' . $pdo->quote($config['schema'])); + } } $driver = $connection->getDriver();