Re: How to convert ByteA to Large Objects

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Jayadevan M <Jayadevan(dot)Maymala(at)ibsplc(dot)com>
Cc: John R Pierce <pierce(at)hogranch(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-general-owner(at)postgresql(dot)org
Subject: Re: How to convert ByteA to Large Objects
Date: 2011-09-16 09:32:57
Message-ID: CAF-3MvOnpdBfdMYWe85Tx0icCzpRM5nQfWyyy-trYsa=n4H=Kw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> Caused by: org.postgresql.util.PSQLException: ERROR: column "docdta" is of
> type bytea but expression is of type oid
> Hint: You will need to rewrite or cast the expression."
>

Looks like that table has a column of type BYTEA, while the code expects it
to be a LOB. Perhaps the easiest fix is to change the table to store a LOB
instead?
One of the benefits of doing that is that you can "stream" LOB's (you access
it like a file; opening, reading, seeking), whereas AFAIK you have to
retrieve BYTEA data as a whole before you can start sending it to the
client.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2011-09-16 10:02:32 Re: Problem with the 9.1 one-click installer Windows7 64bit
Previous Message Harald Fuchs 2011-09-16 09:06:37 Re: PostgreSQL 9.1.0 bug?