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
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly