Re: client_encoding

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Dean Gibson (DB Administrator)" <postgresql(at)ultimeth(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: client_encoding
Date: 2008-02-22 03:59:44
Message-ID: 21678.1203652784@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Dean Gibson (DB Administrator)" <postgresql(at)ultimeth(dot)com> writes:
> If I "ALTER DATABASE ... SET client_encoding TO DEFAULT", is the default
> the "client_encoding" in postgresql.conf when the server was last
> started, or the value at the time the "ALTER DATABASE ... SET
> client_encoding TO DEFAULT" statement is executed?

DEFAULT means that the database isn't overriding anything, so it would
be taken from whatever other source exists for the setting. Your first
suggestion isn't necessarily where it would come from --- but your
second one is definitely wrong.

IIRC client_encoding follows server_encoding unless the client-side code
specifies it wants something else, so this case is not a good example of
the general behavior of ALTER DATABASE.

> What I'm looking for is a way to have the client_encoding of all
> databases track some common setting (eg, the "client_encoding" value in
> postgresql.conf), but that may not be possible.

You can set client_encoding in postgresql.conf if you want to, but
I'm having a hard time understanding why you think that'd be a good
idea --- *particularly* if your database encodings aren't all the same.

regards, tom lane

In response to

  • client_encoding at 2008-02-22 02:49:49 from Dean Gibson (DB Administrator)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-02-22 04:31:34 Re: need some help on figuring out how to write a query
Previous Message Guy Rouillier 2008-02-22 03:33:15 Re: Feedback on PLJava