diff --git a/src/Database/Drivers/PgSqlDriver.php b/src/Database/Drivers/PgSqlDriver.php index c943bb8ca..0b3217e2e 100644 --- a/src/Database/Drivers/PgSqlDriver.php +++ b/src/Database/Drivers/PgSqlDriver.php @@ -218,7 +218,12 @@ public function getForeignKeys(string $table): array public function getColumnTypes(\PDOStatement $statement): array { - return Nette\Database\Helpers::detectTypes($statement); + static $cache; + $item = &$cache[$statement->queryString]; + if ($item === null) { + $item = Nette\Database\Helpers::detectTypes($statement); + } + return $item; }