Skip site navigation (1) Skip section navigation (2)

Re: byteain() doesn't parse correctly

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jered Floyd <jered(at)permabit(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org, dev-server(at)permabit(dot)com
Subject: Re: byteain() doesn't parse correctly
Date: 2001-02-07 16:22:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Jered Floyd <jered(at)permabit(dot)com> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> You're right, there are multiple levels of parsing going on.  The
>> string-literal parser gets first crack before the type-specific
>> input converter does.  If you don't allow for that when counting
>> backslashes etc, you'll get confused for sure.

> Argh. This is really bad.  This means, for example, that I can't have
> NULs in my bytea, which was the whole reason I was using bytea to
> begin with. Actually, maybe not.

Sure you can.  You just have to write them as \000, which actually
will be written \\000 to get through the string-literal parser.
It's not a real *convenient* notation, I agree, but it works.

There has been talk of providing alternate paths, such as functions
that would convert bytea to and from other textual representations
like base64.  Nothing's been done yet though.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Thomas LockhartDate: 2001-02-07 16:52:30
Subject: Re: Re: round - timestamp bug
Previous:From: Jered FloydDate: 2001-02-07 16:18:40
Subject: Re: byteain() doesn't parse correctly

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group