Re: Re: Storing images in PG?

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Andrew SNow <andrew(at)modulus(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: Storing images in PG?
Date: 2001-08-16 09:17:28
Message-ID: 20010816111728.C29792@zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)zf(dot)jcu(dot)cz>
http://home.zf.jcu.cz/~zakkr/

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Justin Clift 2001-08-16 09:27:18 PostgreSQL buffer exploits
Previous Message Andrew SNow 2001-08-16 08:52:32 RE: Re: Storing images in PG?