Thread: Field BLOB

Field BLOB

From
"carloszaparoli"
Date:
I need include a field BLOB.
 
Who???
 
Carlos Zaparoli        (__)]
Business Analyst
Zaparoli Information Technology

Re: Field BLOB

From
"Dirk Bromberg"
Date:
see in the documentation
 
 
 
-----Ursprüngliche Nachricht-----
Von: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] Im Auftrag von carloszaparoli
Gesendet: Montag, 24. Februar 2003 13:38
An: pgsql-jdbc@postgresql.org
Betreff: [JDBC] Field BLOB

I need include a field BLOB.
 
Who???
 
Carlos Zaparoli        (__)]
Business Analyst
Zaparoli Information Technology

Re: LargeObject problems (more INFO)

From
Gustavo Muñoz
Date:
Hi

I posted this yesterday, but got no response, maybe the subject wasn't very descriptive or I didn't provide some key information.

I'm using Windows 2000 Server in English, and Sun  JDK 1.4.1_01.
Postgres' version is 7.3.2.
I read the documentation,
And I did the things exactly as indicated, but my problem is that the LargeObject modifies my data: it keeps the same number of bytes, but they differ. And with the strict-JBDC API, I get an OutOfMemoryError. On this, I know that Postgres crew say this method consumes a lot of memory, but I'm trying to store 10Mb and set Xmx jvm flag very large and always fails.

Maybe someone from TeamB, knows something about encoding problems (target LargeObject method). I expected Postgres just to store de bytes as they were given, in order to be able to retrive them untouched
Maybe I'm not using the right driver. I'm using the driver that is distribuited with cygwin.
I'm going to test this exact code, in Linux.
Next step is to debug the source code. But before doing that I want to be sure I'm doing the right steps.




Here is my original post:
I have inserted a LargeObject using LargeObject Postgres API but when I get back the bytes they are changed in some way. For instance, if I insert the bytes of a zip or a jpg file (and the files are ok, because I can view the contents) when I retrieve the bytes from the database and create new files with the bytes, the original files and the new ones differ. They contain the same number of bytes, but they differ. No longer winzip or iexplorer open the new files, and diff says the files differ.
I'm using windows version of postgres, and jdk1.4.1_01
The field's data type is oid, of course

By the way, if I use the JDBC standard API (setBytes o setBinaryStream using bytea) I get an OutOfMemoryError with files with size equals or larger than 10Mb.

Dirk Bromberg wrote:
see in the documentation
 
 
 
-----Ursprüngliche Nachricht-----
Von: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] Im Auftrag von carloszaparoli
Gesendet: Montag, 24. Februar 2003 13:38
An: pgsql-jdbc@postgresql.org
Betreff: [JDBC] Field BLOB

I need include a field BLOB.
 
Who???
 
Carlos Zaparoli        (__)]
Business Analyst
Zaparoli Information Technology

Re: LargeObject problems (more INFO)

From
Gustavo Muñoz
Date:
Hi:

Sorry, it was my fault, with Large Object API it works fine.
Anyway, anybody knows some workaround about the OutOfMemoryError in the
setBytes and/or setBinaryStream way?

Gus.


Re: LargeObject problems (more INFO)

From
Barry Lind
Date:
Gustavo,

There was a patch posted on 1/31 to stream the data for
setBinaryStream().  If you check the email archives you should be able
to find the patch.  The patch was posted by Chris Smith.  I haven't
gotten around to reviewing this patch yet, but it might help you out.

thanks,
--Barry


Gustavo Muñoz wrote:
> Hi:
>
> Sorry, it was my fault, with Large Object API it works fine.
> Anyway, anybody knows some workaround about the OutOfMemoryError in the
> setBytes and/or setBinaryStream way?
>
> Gus.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>