Re: To store and retrive image data in postgresql

From: Christophe <xof(at)thebuild(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: To store and retrive image data in postgresql
Date: 2008-07-07 20:39:01
Message-ID: E9198697-7CB6-46CD-ABE2-92E9A1AED0C0@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jul 7, 2008, at 12:22 PM, aravind chandu wrote:
> I need to store an image in postgresql database and after
> that i need to retrive the image back.Can you please help me how to
> do this?

Assuming you mean an image as in a binary visual image (like a JPEG),
the data type you want is BYTEA. How to actually get BYTEA data into
and out of PostgreSQL depends on what client library and language you
are using.

If your application allows it, it is often far more efficient to
store a reference to the image in the database (such as a URI or file
path), rather than the image itself.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Keaton Adams 2008-07-07 22:06:41 Query running slow but was running fine before
Previous Message Lennin Caro 2008-07-07 20:04:11 Re: To store and retrive image data in postgresql