Skip site navigation (1) Skip section navigation (2)

Re: How to save a image file in a postgres data field.

From: "Obe, Regina" <robe(dot)dnd(at)cityofboston(dot)gov>
To: <rterry(at)internode(dot)on(dot)net>,<pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to save a image file in a postgres data field.
Date: 2008-09-02 12:40:59
Message-ID: 53F9CF533E1AA14EA1F8C5C08ABC08D204A0137F@ZDND.DND.boston.cob (view raw or flat)
Thread:
Lists: pgsql-novice
> =============================================
> Hear your pain, this was all done on debian linux. binmode was a
gotcha

> I've done it with a bytea column like this

> use DBI ;
> use DBD::Pg qw(:pg_types); #Required for us to use the *bytea* column
=============================================

> I can't interpet the last line which (admittedly in another language)
he says 
> is needed to use the bytea type.

> Any further help appreciated.

> Richard

Rich,

Unfortunately I don't know perl too well so the above is pretty cryptic
to me too. From my cursory reading - seems the above just registers
PostgreSQL datatypes with DBD.

Which language are you programming in?  My default encoding for my
database is UTF-8, but I don't recall having to do anything special that
wasn't already implicitly done by the driver I was using and I think the
npgsql ADO.NET driver already takes care of registering the Pg bytea and
other PG specific data types so my guess is you are not using .NET.
Then again I don't do too much of storing images in the database.

Seems then that whatever you are doing is not translating your data to
bytea format correctly.

Hope that helps,
Regina



-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.


In response to

Responses

pgsql-novice by date

Next:From: Jason DusekDate: 2008-09-03 01:27:45
Subject: telnet examples
Previous:From: Yogesh SharmaDate: 2008-09-01 17:57:31
Subject: Opinion from experts

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group