RE: Storing images in PG? - Mailing list pgsql-general

From Andrew Snow
Subject RE: Storing images in PG?
Date
Msg-id 000601c1266d$a751c810$fa01b5ca@avon
Whole thread Raw
In response to Re: Storing images in PG?  ("Joe Conway" <joseph.conway@home.com>)
Responses Re: Storing images in PG?
List pgsql-general

> I have found (and confirmed by studying the PostgreSQL
> source) that to reliably insert arbitrary binary data into a
> bytea column there are only 3 characters which need to be
> escaped: \000, \047 ( ' ), \134 ( \ ). Here's the PHP
> function that I've been using:


Postgresl, in treating things as strings, handles \000 as NULL as an end
of string.

 select 'abc\000def' as hehehe;
 hehehe
--------
 abc
(1 row)


How do you get the data back from a query, with all the nulls in it?


- Andrew


pgsql-general by date:

Previous
From: "Ben-Nes Michael"
Date:
Subject: Re: Roll Back dont roll back counters
Next
From: Peter Eisentraut
Date:
Subject: Re: confused on maximum characters