dbTalk Databases Forums  

Storing Images

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Storing Images in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ComCast Technical Groups
 
Posts: n/a

Default Storing Images - 01-03-2007 , 07:02 PM






What is the correct data type to store an image in? In MSSQL it's "Image"
what would be the equivalent in PostgreSQL? Or what would be the correct
way to store an image?

Thanks,

Anthony




Reply With Quote
  #2  
Old   
Robert Uhl
 
Posts: n/a

Default Re: Storing Images - 03-26-2007 , 04:47 PM






"ComCast Technical Groups" <ajmnews (AT) com (DOT) cast.net> writes:

Quote:
What is the correct data type to store an image in? In MSSQL it's "Image"
what would be the equivalent in PostgreSQL? Or what would be the correct
way to store an image?
Easy answer first: BLOB (binary large object) data type, specified in a
column as oid (e.g. alter table foo add column image oid.

Long answer: the first thing to consider is why you're storing image
data in the database. It's going to be faster and more space-efficient
to store it on disk and store links (URLs, perhaps) in the database.
However, it could be more convenient to store that data in the db.

Read up on the lo_import and lo_export functions as well.

You could also just use a text column and encode the image with Base64
or some similar encoding, as a text column can hold up to 1GB.

--
Robert Uhl <http://public.xdi.org/=ruhl>
Finding out that the conspiracy loons were more right about Waco than the
Attorney General has pretty much shaken my world view. --Paul Tomblin


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.