Re: minor changes in psql's \encoding command

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Weiping He <laser(at)zhengmai(dot)com(dot)cn>, pgsql-patches(at)postgresql(dot)org
Subject: Re: minor changes in psql's \encoding command
Date: 2003-01-05 05:46:05
Message-ID: 200301050546.h055k6N24019@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Here is an email from December 15 reporting the problem. Seems we need
to address it somehow. Should we throw a warning when the do it?

---------------------------------------------------------------------------

Tom Lane wrote:
> I said:
> > I'd prefer to just document that PQclientEncoding is untrustworthy if
> > the client sets the encoding directly (rather than via PGCLIENTENCODING
> > or PQsetClientEncoding), and similarly that psql's \encoding is not
> > trustworthy if one goes behind its back.
>
> On looking closer, both libpq and psql assume that their current
> internal encoding settings accurately describe the strings they get
> from the backend. So hacking up PQclientEncoding() wouldn't be enough
> to fix all the problems anyway.
>
> I think we need to document that doing "SET client_encoding" directly is
> hazardous to your health with either of these interfaces, and perhaps
> with others as well. Anyone know how JDBC and ODBC deal with encoding?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 0 bytes

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-01-05 05:54:35 Re: minor changes in psql's \encoding command
Previous Message Tom Lane 2003-01-05 05:17:04 Re: minor changes in psql's \encoding command