Re: Bug #728: Interactions between bytea and character encoding

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Anders Hammarquist <iko(at)strakt(dot)com>, pgsql-bugs(at)postgresql(dot)org, Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Subject: Re: Bug #728: Interactions between bytea and character encoding
Date: 2002-08-14 04:56:34
Message-ID: 200208140456.g7E4uYU29659@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


I am hoping for a patch for this for 7.3. Added to open items:

Fix bytea to not encode input string

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

Joe Conway wrote:
> Joe Conway wrote:
> > Bruce Momjian wrote:
> >
> >> Does this mean we don't have to esacpe >0x7f when inputting bytea
> >> anymore?
> >
> >
> > I seem to remember that bytea data was run through the multibute code
> > for some reason, and I don't recall seeing that changed. ISTM that we
> > shouldn't force bytea thought multibyte functions at all.
> >
> > The UNKNOWNIN patch did address part of the problem, just not all of it.
> > Previously all 'unknown' data was initially cast as TEXT, and thus was
> > subject to multibyte character set interpretation. But there was another
> > execution path that was not dealt with. I'll search the archives for the
> > thread.
> >
>
> Here's the remaining issue that I remembered; see:
> http://archives.postgresql.org/pgsql-hackers/2002-04/msg00256.php
>
> The gist of this is that when client and server encoding don't match,
> pg_do_encoding_conversion() gets called, regardless of data type. This
> is the *wrong thing* to do for BYTEA data, I think. Fixing this,
> combined with the UNKNOWNIN/OUT fix we did earlier, should eliminate the
> need to escape the high bit characters when inputting bytea. The only
> characters which *should* need to be escaped are the ones originally
> escaped by PQescapeBytea. IMHO of course ;-)
>
> Joe
>
>
> Joe
>
>
> ---------------------------(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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Joe Conway 2002-08-14 05:05:05 Re: Bug #728: Interactions between bytea and character encoding
Previous Message Bruce Momjian 2002-08-14 02:56:34 Re: Bug #725: ODBC driver problem with internal type PG_TYPE_TIMESTAMP_NO_TMZONE