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

From Karel Zak
Subject Re: Re: Storing images in PG?
Date
Msg-id 20010816111728.C29792@zf.jcu.cz
Whole thread Raw
In response to RE: Re: Storing images in PG?  ("Andrew SNow" <andrew@modulus.org>)
Responses RE: Re: Storing images in PG?  ("Andrew SNow" <andrew@modulus.org>)
List pgsql-general
On Thu, Aug 16, 2001 at 06:52:32PM +1000, Andrew SNow wrote:
>
> >  Yes, but good is encode binary data (image) to same ascii safe
> > encoding like base64, else you will have problem in INSERT/UPDATE
> > queries.
>
> Correct me if I'm wrong, but the only thing "lztext" can't store is
> NULLs, which could escaped somehow with other (rare) characters.  Still
> overhead, but you shouldn't be storing large pieces of binary data this
> way, I think.

 Here is not a problem with storing binary data to some datetype (like
bytea), but problem is with other parts of PG. For example libpq
functions read queries as string, other thing is query parsing where
is needful set correct chars (like quote), etc.
 IMHO if you want to work with queries with no problems and limits is
better prevent all by some encoding. This solution is also portable to
other SQLs because depend on your frontend application only. I haven't
care about CPU time for this, the base64-algorithm is bit operation
only, a problem can be 30% grow of data... (you can use "lztext" that is
compressed datype:-).

             Karel

--
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/

 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

pgsql-general by date:

Previous
From: "Andrew SNow"
Date:
Subject: RE: Re: Storing images in PG?
Next
From: Justin Clift
Date:
Subject: PostgreSQL buffer exploits