From: | Hannu Krosing <hannu(at)tm(dot)ee> |
---|---|
To: | Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at> |
Cc: | Joe Conway <joseph(dot)conway(at)home(dot)com>, Alex Pilosov <alex(at)acecape(dot)com>, Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Re: Toast,bytea, Text -blob all confusing |
Date: | 2001-08-30 14:32:18 |
Message-ID: | 3B8E4E72.1566105A@tm.ee |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Zeugswetter Andreas SB SD wrote:
>
> > > > >For bytea, follow this rule: to escape a null character, use
> this:
> > > > >'\\0'. To escape a backslash, use this: '\\\\'.
>
> Can anybody explain in technical terms why this is implemented
> so inconveniently ?
I think that this has to to with making textin and textout behave
symmetrically, and the requirement that textout must produce a
valid C-string for ASCII transfer format.
> Since bytea is probably not very common among users yet
> we could imho still change it to not do double escapes.
But how ?
> Imho we need to decide where to do the escaping,
> eighter in the parser or in the input functions.
It would be probably hard to make the parser to _not_ unescape some
types, as it does not yet know it
> I think actually the backend parser has no business changing
> constants, he is imho only allowed to parse it, so he knows
> where a constant begins, and where it ends.
If it is any consolation then you have to write the inset of
a single \ from shell command so:
> psql -c "insert into t values('\\\\\\\\')"
;)
------------------
Hannu
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Lockhart | 2001-08-30 14:53:25 | Re: INTERVAL type: SQL92 implementation |
Previous Message | Peter Eisentraut | 2001-08-30 13:28:10 | Re: getting the oid for a new tuple in a BEFORE trigger |