Set psql client encoding from locale by default

Peter Eisentraut <peter_e@gmx.net>

Commit: 02e14562a806a96f38120c96421d39dfa7394192
Author: Peter Eisentraut <peter_e@gmx.net>
Date: 2011-02-19T06:54:58Z
Releases: 9.1.0
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

Files