Re: BLOBs

From: Eugene Yin <eugeneymail(at)ymail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: BLOBs
Date: 2016-01-11 00:37:52
Message-ID: 1119695599.3064803.1452472672882.JavaMail.yahoo@mail.yahoo.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I use the BLOB in an Oracle table to store IMG and document files. Now for Postgres(9.4.5), I have two options, i.e., BYTEA or OID.
With consideration of passing the params (SAVING) from the Java side as follows:
DiskFileItemDeepy file = myFile; InputStream is = null; long fileSize = 0; if (file != null && file.getFileSize() > 0){      is = file.getInputStream();     fileSize = file.getFileSize();     call.setBinaryStream(1, (InputStream)is, (long)fileSize);
}...call.execute();

//When retrieve the data use:
 java.sql.Blob blob = (Blob) resultSet.getBlob(tableColumnName); 

For the purpose mentioned above, which Postgres data type is a better candidate for replacement the BLOB, BYTEA or OID?

Thanks
Eugene

On Saturday, January 9, 2016 11:13 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

Eugene Yin <eugeneymail(at)ymail(dot)com> writes:
> The following statement is excerpted from the 
> "Oracle to Postgres Conversion"
> https://wiki.postgresql.org/wiki/Oracle_to_Postgres_Conversion#Grammar_Differences

My goodness, that's out of date (as you should have guessed from the
reference to "scheduled for an overhaul in summer 2000").  pg_dump
has been able to dump large objects just fine since 8.1 or so.

I don't know what else an Oracle user might be expecting that we don't
have, though, so I'm hesitant to change the text.

            regards, tom lane

In response to

  • Re: BLOBs at 2016-01-10 07:12:42 from Tom Lane

Responses

  • Re: BLOBs at 2016-01-11 10:09:49 from Andreas Joseph Krogh

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Joseph Krogh 2016-01-11 10:09:49 Re: BLOBs
Previous Message Tom Lane 2016-01-10 07:12:42 Re: BLOBs