Image in Postgres

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
phppick
Forum Commoner
Posts: 57
Joined: Thu Aug 14, 2003 5:59 am

Image in Postgres

Post by phppick »

How to Store Image in Postgres Database? Which DataType i need to Use. I am using Postgres 7.4

How to retrive it to display in Web, I am using PHP.

Thanks
markbeadle
Forum Commoner
Posts: 29
Joined: Tue Dec 02, 2003 2:50 am
Location: Aachen, Germany

Post by markbeadle »

Not sure of the answer but a quick question..

Do you really need to store the image within the database or should you store a pointer and image details within the database and use the filesystem to store the image itself ?

Just an alternative
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

Post by fractalvibes »

Use a BLOB to store images. Could be more efficient to just store the link the the image in the database - depends upon the circumstances.

To retrieve, just query the database as usual, and have a script that handles retrieval, setting a header with the proper content type.

fv
phppick
Forum Commoner
Posts: 57
Joined: Thu Aug 14, 2003 5:59 am

Thank you

Post by phppick »

Thanks for the Help
Post Reply