File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,7 +111,13 @@ public function connect()
111111 */
112112 public function getCollation ()
113113 {
114- $ this ->setQuery ('SHOW LC_COLLATE ' );
114+ // https://www.postgresql.org/docs/current/release-16.html
115+ if (version_compare ($ this ->getVersion (), '16.0 ' , '>= ' )) {
116+ $ this ->setQuery ('SELECT datcollate AS lc_collate FROM pg_database WHERE datname = current_database() ' );
117+ } else {
118+ $ this ->setQuery ('SHOW LC_COLLATE ' );
119+ }
120+
115121 $ array = $ this ->loadAssocList ();
116122
117123 return $ array [0 ]['lc_collate ' ];
@@ -127,7 +133,13 @@ public function getCollation()
127133 */
128134 public function getConnectionCollation ()
129135 {
130- $ this ->setQuery ('SHOW LC_COLLATE ' );
136+ // https://www.postgresql.org/docs/current/release-16.html
137+ if (version_compare ($ this ->getVersion (), '16.0 ' , '>= ' )) {
138+ $ this ->setQuery ('SELECT datcollate AS lc_collate FROM pg_database WHERE datname = current_database() ' );
139+ } else {
140+ $ this ->setQuery ('SHOW LC_COLLATE ' );
141+ }
142+
131143 $ array = $ this ->loadAssocList ();
132144
133145 return $ array [0 ]['lc_collate ' ];
You can’t perform that action at this time.
0 commit comments