"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