Re: store in bytea - Mailing list pgsql-general

From Lincoln Yeoh
Subject Re: store in bytea
Date
Msg-id 3.0.5.32.20010826230343.016477c0@192.228.128.13
Whole thread Raw
In response to Re: store in bytea  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
At 09:28 AM 8/24/01 -0400, Tom Lane wrote:
>"Ben-Nes Michael" <miki@canaan.co.il> writes:
>> On the theoretical issue, can I use TEXT field to store binary ?
>
>TEXT will not handle null (zero) bytes.  If you are using a multibyte
>character set, it will likely also do the wrong thing with byte
>sequences that are illegal or incomplete multibyte characters.
>
>Use BYTEA if you want to store arbitrary byte sequences --- that's what
>it's for.

I wanted to use bytea wasn't sure how though. So I used base64 and text.
Yeah that is ugly but it works.

With bytea I didn't understand how to quote and unquote stuff. And how
stuff is stored. At that time the docs were sparse on it. I didn't know
what characters I'd need to unquote and quote and how, yeah null was one
but the others?

Sure people can use the source to figure out how to use bytea. But what if
the source is different from the intended behaviour and the source is fixed
later.

Don't want to be hit by a gotcha after writing lots of code y'know.

So base64 and text it was. It was either that or store in the filesystem
(that's what I did with 6.5 - sorry but I have no confidence in postgresql
BLOBs).

Cheerio,
Link.


pgsql-general by date:

Previous
From: Lincoln Yeoh
Date:
Subject: Re: MySQL's (false?) claims... (was: Re: PL/java?)
Next
From: Francesco Casadei
Date:
Subject: Re: version 1 C-Language Functions