+ try {
+ // If called from the command-line (e.g. importDump), only show errors.
+ // No transaction should be open at this point, so the problem of the SET
+ // effects being rolled back should not be an issue.
+ // See https://www.postgresql.org/docs/8.3/sql-set.html
+ $variables = [];
+ if ( $this->cliMode ) {
+ $variables['client_min_messages'] = 'ERROR';
+ }
+ $variables += [
+ 'client_encoding' => 'UTF8',
+ 'datestyle' => 'ISO, YMD',
+ 'timezone' => 'GMT',
+ 'standard_conforming_strings' => 'on',
+ 'bytea_output' => 'escape'
+ ];
+ foreach ( $variables as $var => $val ) {
+ $this->query(
+ 'SET ' . $this->addIdentifierQuotes( $var ) . ' = ' . $this->addQuotes( $val ),
+ __METHOD__,
+ self::QUERY_IGNORE_DBO_TRX | self::QUERY_NO_RETRY
+ );
+ }