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

From: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
To: pgsql <pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to save a image file in a postgres data field.
Date: 2008-09-03 10:53:15
Message-ID: 264855a00809030353q5b403a36jea25039a8262e41b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Sep 3, 2008 at 6:52 AM, Sean Davis <sdavis2(at)mail(dot)nih(dot)gov> wrote:
> On Wed, Sep 3, 2008 at 3:08 AM, richard terry <rterry(at)gnumed(dot)net> wrote:
>> On Tue, 2 Sep 2008 10:40:59 pm Obe, Regina wrote:
>>> > =============================================
>>> > 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.
>>> >
>> I've made a little progress with some help from a gambas user but still
>> failing. Perhaps these two sample queries which stall will prompt someone to
>> guide me in the correct direction:
>
>> HINT: Use the escape string syntax for backslashes, e.g., E'\\'.
>
> The hint is probably helpful. See here:
>
> http://archives.postgresql.org/pgsql-jdbc/2005-10/msg00007.php
> http://www.postgresql.org/docs/8.3/static/datatype-binary.html
>
> Both the documentation and the mailing lists are searchable, just in
> case you need more detail.
>
> Hope that helps,
> Sean
>
>>
>>> > 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.
>>
>> --
>> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-novice
>>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Sean Davis 2008-09-03 11:33:23 Re: telnet examples
Previous Message richard terry 2008-09-03 07:08:44 Re: How to save a image file in a postgres data field.