Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-docspgsql-hackerspgsql-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: README.mb.tw
Description: text/plain (9.8 KB)

In response to

Responses

pgsql-docs by date

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

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group