Re: pg_client_encoding

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: pg_client_encoding
Date: 2001-09-10 07:40:32
Message-ID: 20010910094032.E14578@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 10, 2001 at 01:46:28PM +0900, Tatsuo Ishii wrote:
> Hi,
>
> I'm going to add a new function "pg_client_encoding" returning the
> current client side encoding name. I know there is a similar
> functionality already there in PostgreSQL (show client_encoding) but
> it's pain to handle notice message by a program.
>
> Also note that JDBC driver and maybe some other APIs use
> getdatabaseencoding, but I think it's not adequate for FE APIs to know
> actual encoding passed to FE side, since an encoding conversion might
> be made in BE side. For example, if PGCLIENTENCODING is set to SJIS
> before starting postmaster, the actual encoding passed to FE would be
> SJIS even the database encoding is EUC_JP.
>
> Comments?

What some common function like pg_show():

SELECT pg_show('CLIENT_ENCODING');
SELECT pg_show('SERVER_ENCODING');
SELECT pg_show('DATESTYLE');

that returns same result as standard 'SHOW' command, but not as NOTICE?
A lot of code for this function can be shared with current SHOW routines.
I'm sure non-libpq clients (like JDBC) maintainers will happy with it.

Karel

--
Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2001-09-10 07:59:51 pg_result -list
Previous Message Karel Zak 2001-09-10 07:21:05 Re: INV_ARCHIVE?