Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql 16 release #295

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/Pgsql/PgsqlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ public function connect()
*/
public function getCollation()
{
$this->setQuery('SHOW LC_COLLATE');
// https://www.postgresql.org/docs/current/release-16.html
if (version_compare($this->getVersion(), '16.0', '>=')) {
$this->setQuery('SELECT datcollate AS lc_collate FROM pg_database WHERE datname = current_database()');
} else {
$this->setQuery('SHOW LC_COLLATE');
}

$array = $this->loadAssocList();

return $array[0]['lc_collate'];
Expand All @@ -127,7 +133,13 @@ public function getCollation()
*/
public function getConnectionCollation()
{
$this->setQuery('SHOW LC_COLLATE');
// https://www.postgresql.org/docs/current/release-16.html
if (version_compare($this->getVersion(), '16.0', '>=')) {
$this->setQuery('SELECT datcollate AS lc_collate FROM pg_database WHERE datname = current_database()');
} else {
$this->setQuery('SHOW LC_COLLATE');
}

$array = $this->loadAssocList();

return $array[0]['lc_collate'];
Expand Down