From 87bec86ae704cbec7a809c054540939e4218e7fd Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 23 Feb 2009 21:23:14 +0000 Subject: [PATCH] (bug 17460) Client ecoding is now correctly set for PostgreSQL, as we do for MySQL with "SET NAMES utf8" --- RELEASE-NOTES | 1 + includes/db/DatabasePostgres.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 437824214a..26e333d9d0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -219,6 +219,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN PostgreSQL * (bug 17546) Correct Tongan language native name is "lea faka-Tonga" * (bug 17621) Special:WantedFiles has no link to Special:Whatlinkshere +* (bug 17460) Client ecoding is now correctly set for PostgreSQL == API changes in 1.15 == * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 6b343b598d..ee1e03378f 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -174,9 +174,11 @@ class DatabasePostgres extends Database { global $wgCommandLineMode; ## If called from the command-line (e.g. importDump), only show errors if ($wgCommandLineMode) { - $this->doQuery("SET client_min_messages = 'ERROR'"); + $this->doQuery( "SET client_min_messages = 'ERROR'" ); } + $this->doQuery( "SET client_encoding='UTF8'" ); + global $wgDBmwschema, $wgDBts2schema; if (isset( $wgDBmwschema ) && isset( $wgDBts2schema ) && $wgDBmwschema !== 'mediawiki' @@ -185,7 +187,7 @@ class DatabasePostgres extends Database { ) { $safeschema = $this->quote_ident($wgDBmwschema); $safeschema2 = $this->quote_ident($wgDBts2schema); - $this->doQuery("SET search_path = $safeschema, $wgDBts2schema, public"); + $this->doQuery( "SET search_path = $safeschema, $wgDBts2schema, public" ); } return $this->mConn; -- 2.20.1