Re: PQescapeBytea is not multibyte aware - Mailing list pgsql-hackers

From Joe Conway
Subject Re: PQescapeBytea is not multibyte aware
Date
Msg-id 3CAE1CEB.9030401@joeconway.com
Whole thread Raw
In response to PQescapeBytea is not multibyte aware  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Responses Re: PQescapeBytea is not multibyte aware  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
> 
>>I think you're correct that in a client/database encoding mismatch 
>>scenario, there would be bigger problems. Thoughts on this?
> 
> 
> This scenario is probably why Tatsuo wants PQescapeBytea to octalize
> everything with the high bit set; I'm not sure there's any lesser way

Yuck! At that point you're no better off than converting to hex (and 
worse off than converting to base64) for storage.

SQL99 actually defines BLOB as a binary string literal comprised of an 
even number of hexadecimal digits, in single quotes, preceded by "X", 
e.g. X'1a43fe'. Should we be looking at implementing the standard 
instead of, or in addition to, octalizing? Maybe it is possible to do 
this by creating a new datatype, BLOB, which uses new IN/OUT functions, 
but otherwise uses the various bytea functions?


> out.  Nonetheless, if UNKNOWN conversion introduces additional failures
> then it makes sense to fix that.

I'll follow up on this then.

Joe




pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Suggestion for optimization
Next
From: Tom Lane
Date:
Subject: Re: PQescapeBytea is not multibyte aware