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

Re: Toast, Text, blob bytea Huh?

From: ryan_rs(at)c4(dot)com (Ryan)
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Toast, Text, blob bytea Huh?
Date: 2001-09-04 16:32:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
joseph(dot)conway(at)home(dot)com ("Joe Conway") wrote in message news:<02a101c12c0e$37856d60$48d210ac(at)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


In response to


pgsql-hackers by date

Next:From: Bruce MomjianDate: 2001-09-04 16:44:49
Subject: Re: Bytea/Base64 encoders for libpq - interested?
Previous:From: Tom LaneDate: 2001-09-04 16:01:11
Subject: Re: Bytea/Base64 encoders for libpq - interested?

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