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

From Eric Ridge
Subject RE: Re: Re: Storing images in PG?
Date
Msg-id D3ADE25911614840BC69C72E3171E4ED0280B8@tcdiexch.tcdi.com
Whole thread Raw
In response to Storing images in PG?  ("Dr. Evil" <drevil@sidereal.kz>)
Responses Re: Re: Re: Storing images in PG?  (Gunnar Rønning <gunnar@polygnosis.com>)
List pgsql-general
> only, a problem can be 30% grow of data... (you can use
> "lztext" that is compressed datype:-).

Alternativly, you can store "pointers" to the images in the database.
Such as a local filepath or url (file:///usr/local/myimages/foo.gif or
ftp://user:passwd@host/pub/myimages/foo.gif).  Then you could use wget
to get the file bytes for you.

The nice thing about doing this is that you don't need to store images
and data on the same server.  It gives you room to expand your storage.
It also improves performance b/c I'm sure FTP or a local file copy is
more efficient than the Postgres network protocol.  Plus, no need to
encode and constantly decode the bytes.

Also, if you're not going to be searching the bytes of the file (which
I'm sure you're not), why put it in the database?

eric


pgsql-general by date:

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