Re: BYTEA - Mailing list pgsql-general

From Richard Huxton
Subject Re: BYTEA
Date
Msg-id 200209201015.14661.dev@archonet.com
Whole thread Raw
In response to Re: BYTEA  ("Timur V. Irmatov" <itvthor@sdf.lonestar.org>)
List pgsql-general
On Friday 20 Sep 2002 9:46 am, Timur V. Irmatov wrote:
> Jeff!
>
> Friday, September 20, 2002, 1:24:28 PM, You wrote:
>
> JD> I don't really see a way postgres could do it any better, since the
> queries JD> and results are both strings, so there have to be rules about
> what a string JD> might include. Base64 works nicely because it's fairly
> compact, and all JD> "safe" text.
>
> Hm.. If i have a varchar field then if I want to insert a string
> some'tex\t into it, I quote it like that: 'some\'tex\\t' .. but if I
> want to insert the same into bytea field I must quote it more:
> 'some\\'tex\\\\' .. why ???

Because it *is* parsed twice IIRC (bear in mind I'm not a developer and I
haven't looked at the code yet).

The first parse gets it into the system *as a chunk of text*, so for varchar
there's nothing more to be done. If you're storing a bytea (or other) then it
needs to be converted to that form, i.e. parsed again.

- Richard Huxton

pgsql-general by date:

Previous
From: Frank Joerdens
Date:
Subject: Re: RES: PHP + PostgreSQL
Next
From: Yury Bokhoncovich
Date:
Subject: Re: missed features and unhappy changes when pg 7.1->7.2