Re: initdb stores default client_encoding from environment-variable

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: initdb stores default client_encoding from environment-variable
Date: 2010-04-15 00:55:08
Message-ID: 201004150055.o3F0t8U17108@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Perhaps this is some Solaris-specific change he is seeing.

---------------------------------------------------------------------------

Craig Ringer wrote:
> [re-posting as I mistakenly sent this only to the OP]
>
> On 09/04/10 16:49, Wolfgang.Koenig wrote:
> > initdb stores default client_encoding from environment-variable
> >
> >
> > Postgres Version: 8.4.3 and 8.3.6
> > Operating System: Sun Solaris 5.10 and SuseEnterprise 9
> >
> > When a database is initialized with the initdb-command, the default
> > client_enconding, which will be stored in the DB, depends on the value
> > of the environment-variable PGCLIENTENCODING at the time of running
> > initdb. This behaviour is not documented.
> > Furthermore I didn't find a command to change this
> > default client_encoding in the database later.
> > The default client_encoding does not depend on the database encoding!
>
>
> I cannot reproduce this issue based on the test script you've provided.
> However, I was testing on Ubuntu 9.10, not a vanilla 8.4, so this
> can't be taken as definitive.
>
> $ env | grep PG
> $ PGPORT=7654 psql -U postgres postgres -c 'show client_encoding;'
> client_encoding
> -----------------
> UTF8
> (1 row)
>
> $ PGPORT=7654 psql -U postgres postgres
> (snip blah blah)
> postgres=# show port ;
> port
> ------
> 7654
> (1 row)
> postgres=# \l
> List of databases
> Name | Owner | Encoding | Collation | Ctype | Access
> privileges
> -----------+----------+----------+-------------+-------------+-----------------------
> postgres | postgres | UTF8 | en_AU.UTF-8 | en_AU.UTF-8 |
> template0 | postgres | UTF8 | en_AU.UTF-8 | en_AU.UTF-8 | =c/postgres
> :
> postgres=CTc/postgres
> template1 | postgres | UTF8 | en_AU.UTF-8 | en_AU.UTF-8 | =c/postgres
> :
> postgres=CTc/postgres
> (3 rows)
>
>
>
> $ PGCLIENTENCODING="WIN1250" PGPORT=7654 psql -U postgres postgres -c
> 'show client_encoding;'
> client_encoding
> -----------------
> WIN1250
> (1 row)
>
>
> --
> Craig Ringer
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message John Regehr 2010-04-15 01:22:31 Re: BUG #5416: int4inc() is wrong
Previous Message Alex Soto Paez 2010-04-15 00:15:06 BUG #5423: problems installing postgresql-8.4 deleted folder / .s.PGSQL.lock not initiate the connecti