@@ -185,16 +185,15 @@ public function raw_connect(string $dbhost, string $dbuser, string $dbpass, stri
185
185
$ connection .= " connect_timeout= " .$ this ->dboptions ['connecttimeout ' ];
186
186
}
187
187
188
+ // ALTER USER and ALTER DATABASE are overridden by these settings.
189
+ $ options = ['-c client_encoding=utf8 ' , '-c standard_conforming_strings=on ' ];
188
190
if (empty ($ this ->dboptions ['dbhandlesoptions ' ])) {
189
- // ALTER USER and ALTER DATABASE are overridden by these settings.
190
- $ options = array ('--client_encoding=utf8 ' , '--standard_conforming_strings=on ' );
191
191
// Select schema if specified, otherwise the first one wins.
192
192
if (!empty ($ this ->dboptions ['dbschema ' ])) {
193
193
$ options [] = "-c search_path= " . addcslashes ($ this ->dboptions ['dbschema ' ], "' \\" );
194
194
}
195
-
196
- $ connection .= " options=' " . implode (' ' , $ options ) . "' " ;
197
195
}
196
+ $ connection .= " options=' " . implode (' ' , $ options ) . "' " ;
198
197
199
198
if (isset ($ this ->dboptions ['ssl ' ])) {
200
199
$ sslmode = $ this ->dboptions ['ssl ' ];
@@ -246,12 +245,6 @@ public function raw_connect(string $dbhost, string $dbuser, string $dbpass, stri
246
245
if (!empty ($ this ->dboptions ['dbschema ' ])) {
247
246
throw new dml_connection_exception ('You cannot specify a schema with dbhandlesoptions, use the database to set it. ' );
248
247
}
249
- if (pg_client_encoding ($ this ->pgsql ) != 'UTF8 ' ) {
250
- throw new dml_connection_exception ('client_encoding = UTF8 not set, it is: ' . pg_client_encoding ($ this ->pgsql ));
251
- }
252
- if (pg_escape_string ($ this ->pgsql , '\\' ) != '\\' ) {
253
- throw new dml_connection_exception ('standard_conforming_strings = on, must be set at the database. ' );
254
- }
255
248
}
256
249
257
250
// Connection stabilised and configured, going to instantiate the temptables controller
0 commit comments