From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Ryan <ryan_rs(at)c4(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Toast, Text, blob bytea Huh? |
Date: | 2001-09-10 15:22:52 |
Message-ID: | 200109101522.f8AFMqI26298@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
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
> (!!)
The linefeed escape was reported by a PHP users and perhaps there is an
issue with PHP only. Not sure.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Joe Conway | 2001-09-10 16:13:14 | Re: x = NULL |
Previous Message | Lamar Owen | 2001-09-10 15:17:28 | Re: [HACKERS] Build problem with CVS version |