Re: Toast, Text, blob bytea Huh? - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Toast, Text, blob bytea Huh?
Date
Msg-id 002401c13a09$72b51030$0705a8c0@jecw2k1
Whole thread Raw
In response to Re: Toast, Text, blob bytea Huh?  ("Joe Conway" <joseph.conway@home.com>)
List pgsql-hackers
> joseph.conway@home.com ("Joe Conway") wrote in message
news:<02a101c12c0e$37856d60$48d210ac@jecw2k1>...
> ... snip
> > BYTEA is very similar to TEXT, except that it is intended for binary
data. I
> > recently posted a PHP function which escapes binary in order to allow
> > inserting it into a bytea column (on the pgsql-general list). At a
minimum
> > there are 4 characters which must be escaped. They are ACSII 0, 10, 39,
and
> > 92. They must reach PostgreSQL looking like \\000, \\012, \\047, and
\\134
> > respectively (actually 39 could be \' and 92 could be \\\\, but it is
> > simpler to be consistent).
> ... snip
>
> Is it actually necessary to escape \012 (linefeed) in a query?  My
> brief testing using psql or python pygresql seemed to work ok with
> only \000, \', and \\ escaped.  Gosh, maybe all my data is corrupted
> (!!)
>

Sorry the response is a week late, but your post just hit the list (at least
I just got it). I found after sending this, that the problem with linefeeds
was in my PHP code, so you should be OK :-)

Sorry for the confusion I may have caused!

Joe




pgsql-hackers by date:

Previous
From: johan27@advalvas.be
Date:
Subject: I have a serious problem with hanging backends.:SELECT waiting
Next
From: Bruce Momjian
Date:
Subject: Re: Toast, Text, blob bytea Huh?