agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Eugene Yin <eugeneymail@ymail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: BLOBs
Date: Mon, 11 Jan 2016 00:37:52 +0000 (UTC)
Message-ID: <1119695599.3064803.1452472672882.JavaMail.yahoo@mail.yahoo.com> (raw)
In-Reply-To: <15645.1452409962@sss.pgh.pa.us>
References: <21791464.2842310.1452406802668.JavaMail.yahoo.ref@mail.yahoo.com>
	<21791464.2842310.1452406802668.JavaMail.yahoo@mail.yahoo.com>
	<15645.1452409962@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@sss.pgh.pa.us> wrote:
 

 Eugene Yin <eugeneymail@ymail.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


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


  

view thread (20+ messages)  latest in thread

Message-ID: <1119695599.3064803.1452472672882.JavaMail.yahoo@mail.yahoo.com>
Permalink:  ../1119695599.3064803.1452472672882.JavaMail.yahoo@mail.yahoo.com/
Also on:    postgresql.org/message-id/1119695599.3064803.1452472672882.JavaMail.yahoo@mail.yahoo.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: eugeneymail@ymail.com, tgl@sss.pgh.pa.us
  Subject: Re: BLOBs
  In-Reply-To: <1119695599.3064803.1452472672882.JavaMail.yahoo@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox