Re: pg_client_encoding
От | Karel Zak |
---|---|
Тема | Re: pg_client_encoding |
Дата | |
Msg-id | 20010910094032.E14578@zf.jcu.cz обсуждение исходный текст |
Ответ на | pg_client_encoding (Tatsuo Ishii <t-ishii@sra.co.jp>) |
Список | 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@zf.jcu.cz>http://home.zf.jcu.cz/~zakkr/C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
В списке pgsql-hackers по дате отправления: