Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aIQXd-0003z8-Il for pgsql-sql@arkaria.postgresql.org; Mon, 11 Jan 2016 00:41:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aIQXc-00046g-Hf for pgsql-sql@arkaria.postgresql.org; Mon, 11 Jan 2016 00:41:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aIQXa-000455-0E for pgsql-sql@postgresql.org; Mon, 11 Jan 2016 00:40:58 +0000 Received: from nm32-vm6.bullet.mail.gq1.yahoo.com ([98.136.216.229]) by makus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aIQXW-0003g5-6X for pgsql-sql@postgresql.org; Mon, 11 Jan 2016 00:40:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1452472852; bh=2bamlQdjdtSgCmEmKJ5IZR7+DD3Ccev5ga6ofj0rTOQ=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=hGjFxrY+0A/NRD8s6X/A9SurJCQozX0Pt03fAmYTrq8xbN4eJMBHZm7DoXwEwvW7BVQc/16zovz4taFRfGcG/lI5Hoj/2deSV7SP35Eo8GYrGyVaXqIW9yZX4OFUj7r1VwLVsAL9du8Rm70KidfPAOBsiA9PtUrsYia4FL22rktDoe1oqS3qPmezmOiYnLrYXIx87toMf9XGXDcSJdpXgAbZ6ntmka12Gap3yyOY2aOsmcvni/tJdp7/JeAIUppqPKkc5cZYEx803dlpTteja7vyohBNLVUDoIf500+PrRDA8qoSG5uYan/O0c+81kwsLdKEHaunRnA4ITcF61QAGA== Received: from [127.0.0.1] by nm32.bullet.mail.gq1.yahoo.com with NNFMP; 11 Jan 2016 00:40:52 -0000 Received: from [216.39.60.183] by nm32.bullet.mail.gq1.yahoo.com with NNFMP; 11 Jan 2016 00:37:53 -0000 Received: from [66.196.81.172] by tm19.bullet.mail.gq1.yahoo.com with NNFMP; 11 Jan 2016 00:37:53 -0000 Received: from [98.139.212.250] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 11 Jan 2016 00:37:53 -0000 Received: from [127.0.0.1] by omp1059.mail.bf1.yahoo.com with NNFMP; 11 Jan 2016 00:37:53 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 677647.40454.bm@omp1059.mail.bf1.yahoo.com X-YMail-OSG: 51h2lo4VM1nJgXVllDVG2lz9Eu1UO9tWLLcdHTXhZPoS715p0HybyQzPHXVsN.M Vos0I5uzw23Ls_ZXOD03SDP1fa493GrfxpvbNP54enV5B.BsJK4KvfjU1ly62bljUaWkSGGbYSuE KvyyVn6C9ksfHdJ0_ZWJ5bJNv7.A.3G51yqjtoNZfRsRJvKPUOI2iRFTrrdICLRv4VRzP2hLQebo AJqCFlkWeFOxQFotFl27fext5L19t3Bmsye6yBfKQc6rtfzDonT2GoGHEGzjGamSBEZie5J9N_uT WYMQgzLjf7FzkBqG94DbjuZekZFR8oH2WQC4V2Dk8gXxTaUoyixAlB7yPyHFn3ItReoDU_WZlZar laF8buU.rQjTmn0ADVdih31h7nVUtxaM0ivk4wUQeRatlGbtDOJT.c1.Xuu_77iHDOFo3pNDYJlI LIza61h_VaFb1RKopCu380vvaB9KReE2IniNYUlkAwNi71bDoDsE0iyh2V7Zql09R8FyLfPNfNxo sOUeh1WP8pUkLvN4q_kyBpuMLua6R93JZKG_hEXVMA3Cj Received: by 76.13.26.143; Mon, 11 Jan 2016 00:37:53 +0000 Date: Mon, 11 Jan 2016 00:37:52 +0000 (UTC) From: Eugene Yin Reply-To: Eugene Yin To: Tom Lane Cc: "pgsql-sql@postgresql.org" Message-ID: <1119695599.3064803.1452472672882.JavaMail.yahoo@mail.yahoo.com> 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> Subject: Re: BLOBs MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3064802_1325166372.1452472672873" Content-Length: 16279 X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org ------=_Part_3064802_1325166372.1452472672873 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=C2=A0(SAVING) from the Java side a= s follows: DiskFileItemDeepy file =3D myFile; InputStream is =3D null; long fileSize = =3D 0; if (file !=3D null && file.getFileSize() > 0){ =C2=A0=C2=A0=C2=A0=C2= =A0 is =3D file.getInputStream(); =C2=A0=C2=A0=C2=A0=C2=A0fileSize =3D file= .getFileSize(); =C2=A0=C2=A0=C2=A0=C2=A0call.setBinaryStream(1, (InputStrea= m)is, (long)fileSize); }...call.execute();=20 //When retrieve the data use: =C2=A0java.sql.Blob blob =3D (Blob) resultSet.getBlob(tableColumnName);=C2= =A0=20 For the purpose mentioned above, which Postgres data type is a better candi= date for replacement the BLOB, BYTEA or OID? Thanks Eugene =20 On Saturday, January 9, 2016 11:13 PM, Tom Lane wro= te: =20 Eugene Yin writes: > The following statement is excerpted from the=C2=A0 > "Oracle to Postgres Conversion" > https://wiki.postgresql.org/wiki/Oracle_to_Postgres_Conversion#Grammar_Di= fferences My goodness, that's out of date (as you should have guessed from the reference to "scheduled for an overhaul in summer 2000").=C2=A0 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. =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 regards, tom lane --=20 Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql ------=_Part_3064802_1325166372.1452472672873 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I u= se the BLOB in an Oracle table to store IMG and document files. Now for Po= stgres(9.4.5), I have two options, i.e., BYTEA or OID.
<= div id=3D"yui_3_16_0_1_1452227859253_128440" dir=3D"ltr">
With consideration of passing the params <= /span>(SAVING) from the Java side as follows:

DiskFileItemDeepy file =3D myFil= e; =20 =09=09=09=09=09InputStream is =3D null; =09=09=09=09=09long fileSize =3D 0; =09=09=09=09=09if (file !=3D null && file.getFileSize() > 0){=20     =09=09=09=09=09=09is =3D file.getInputStream();=20 =09=09=09=09=09=09    fileSize =3D file.getFileSize();= =20 =09=09=09=09=09=09    call.setBinaryStream(1, (InputStr= eam)is, (long)fileSize);
}=
...
call.exec= ute();

=

//When re= trieve the data use:
 java.sql.Blob blob =3D (Blob) resultSet.getBlob(tableColumnName);  <= /span>


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




Eugene



On Satur= day, January 9, 2016 11:13 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:


Eugene Yin <eugeneymail@ymail.com> writes:

> The following statement is ex= cerpted from the 
> "Oracle to Postgres Conversio= n"
> https://wiki.postgresql.org/wiki/Oracle_to_Postgres_Con= version#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 si= nce 8.1 or so.

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

            regards, tom la= ne


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



=
------=_Part_3064802_1325166372.1452472672873--