About PQsetClientEncoding(),"SET NAMES",and "SET CLIENT_ENCODING"

From: Chih-Chang Hsieh <cch(at)cc(dot)kmu(dot)edu(dot)tw>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: About PQsetClientEncoding(),"SET NAMES",and "SET CLIENT_ENCODING"
Date: 2000-12-27 11:55:47
Message-ID: 3A49D8C3.5498BA62@cc.kmu.edu.tw
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers pgsql-patches

Tatsuo Ishii wrote:

> Here are the patches I promised against PHP
> 3.0.15 or later.
>
> To set the client encoding to BIG5:
>
> pg_setclientencoding($cid, "BIG5");
>
> ($cid is the connection id)
>
> To get the current client encoding:
>
> pg_clientencoding($cid);
>
> Note that these fucntions are already included in the latest PHP4.

Thank you!
Your README.mb has been translate into Chinese (Big5 encoding) in the
attachement.
Would someone like to review it?
After translating it, I still have one question: (Sorry, I have not read the
source code.)
What is the difference among "libpq -- PQsetClientEncoding()",
"SQL command -- SET NAMES", and
"SQL command -- SET CLIENT_ENCODING"?
For example: If we use PHP (>4.0.2), which way is correct or mostly correct?

1. pg_setclientencoding($cid, "BIG5")
2. pg_exec("SET NAMES 'BIG5'")
3. pg_exec("SET CLIENT_ENCODING TO 'BIG5'")

--
Chih-Chang Hsieh

Attachment Content-Type Size
README.mb.tw text/plain 9.8 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Michael Graff 2000-12-27 16:09:27 Rather incorrect text in admin guide
Previous Message Paul Govereau 2000-12-26 21:52:51 Inheritance docs error.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Snow 2000-12-27 11:59:08 RE: GEQO status?
Previous Message Brent Verner 2000-12-27 11:29:16 Re: [HACKERS] Re: Tuple-valued datums on Alpha (was Re: 7.1 on DEC/Alpha)

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2000-12-27 15:08:29 Re: [HACKERS] Re: Tuple-valued datums on Alpha (was Re: 7.1 on DEC/Alpha)
Previous Message Brent Verner 2000-12-27 11:29:16 Re: [HACKERS] Re: Tuple-valued datums on Alpha (was Re: 7.1 on DEC/Alpha)