pgsql: Set psql client encoding from locale by default

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Set psql client encoding from locale by default
Date: 2011-02-19 07:02:00
Message-ID: E1PqgpM-00038U-L0@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Set psql client encoding from locale by default

Add a new libpq connection option client_encoding (which includes the
existing PGCLIENTENCODING environment variable), which besides an
encoding name accepts a special value "auto" that tries to determine
the encoding from the locale in the client's environment, using the
mechanisms that have been in use in initdb.

psql sets this new connection option to "auto" when running from a
terminal and not overridden by setting PGCLIENTENCODING.

original code by Heikki Linnakangas, with subsequent contributions by
Jaime Casanova, Peter Eisentraut, Stephen Frost, Ibrar Ahmed

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/02e14562a806a96f38120c96421d39dfa7394192

Modified Files
--------------
doc/src/sgml/libpq.sgml | 36 ++++++++++++++------
doc/src/sgml/ref/psql-ref.sgml | 11 ++++++
src/bin/psql/command.c | 8 +++--
src/bin/psql/startup.c | 8 +++--
src/interfaces/libpq/.gitignore | 1 +
src/interfaces/libpq/Makefile | 6 ++--
src/interfaces/libpq/fe-connect.c | 24 +++++++++++--
src/interfaces/libpq/fe-protocol2.c | 60 +++++++++++++++++++++++++++++++++++
src/interfaces/libpq/fe-protocol3.c | 3 ++
src/interfaces/libpq/libpq-int.h | 3 ++
10 files changed, 136 insertions(+), 24 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2011-02-19 13:14:57 pgsql: Initialize variable to quiet compiler.
Previous Message Tom Lane 2011-02-19 05:08:04 pgsql: Create the catalog infrastructure for foreign-data-wrapper handl