Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aIZRH-0001Cc-5M for pgsql-sql@arkaria.postgresql.org; Mon, 11 Jan 2016 10:11:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aIZRG-0004v0-6n for pgsql-sql@arkaria.postgresql.org; Mon, 11 Jan 2016 10:11:02 +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 1aIZQG-0003ls-7S for pgsql-sql@postgresql.org; Mon, 11 Jan 2016 10:10:00 +0000 Received: from post.visena.com ([46.226.10.50]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aIZQC-0006tA-7u for pgsql-sql@postgresql.org; Mon, 11 Jan 2016 10:09:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=visena.com; s=20141101.wh; h=Content-Type:MIME-Version:Subject:In-Reply-To:Message-ID:To:From:Date; bh=dALwYGCrtfRvazkAktmFRjZA8HzVYY8olSzXV+AbGcQ=; b=AfGww54WKAqhzG1dYzLxHjqiQ4IVNmuzgcZ+Cmw7oNkH89TpHi2YmzRVmBFT9HKAwwJ4ampiwoqhGvfSiIjim0KcbkPt4IUv/1NRcIvPl7IUrqiiSlQYYGw3PucHMlptfLpwuAhTeOYrD4gQM6sK6j0CzE8le20NojwSWod38rY=; Received: from [10.0.1.10] (helo=tc7-visena.wh.internal.visena.com) by post.visena.com with esmtp (Exim 4.82) (envelope-from ) id 1aIZQ6-0000mb-46 for pgsql-sql@postgresql.org; Mon, 11 Jan 2016 11:09:52 +0100 Received: from localhost ([127.0.0.1] helo=tc7-visena.wh.internal.visena.com) by tc7-visena.wh.internal.visena.com with esmtp (Exim 4.82) (envelope-from ) id 1aIZQ6-0002Ld-1u for pgsql-sql@postgresql.org; Mon, 11 Jan 2016 11:09:50 +0100 Date: Mon, 11 Jan 2016 11:09:49 +0100 (CET) From: Andreas Joseph Krogh To: pgsql-sql@postgresql.org Message-ID: In-Reply-To: <1119695599.3064803.1452472672882.JavaMail.yahoo@mail.yahoo.com> Subject: Re: BLOBs MIME-Version: 1.0 X-Mailer: Visena Mail 2.0.0-SNAPSHOT X-Spam-Score: -1.0 X-Spam-Report: SpamAssasin (score=-1.0, required 5.0 ALL_TRUSTED=-1, HTML_MESSAGE=0.001) X-Pg-Spam-Score: -2.0 (--) Content-Type: multipart/related; boundary="----=_Part_48_898958858.1452506989969" 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_47_1139110249.1452506989969 Content-Type: multipart/related; boundary="----=_Part_48_898958858.1452506989969" ------=_Part_48_898958858.1452506989969 Content-Type: multipart/alternative; boundary="----=_Part_49_1560979233.1452506989986" ------=_Part_49_1560979233.1452506989986 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable P=C3=A5 mandag 11. januar 2016 kl. 01:37:52, skrev Eugene Yin >: I use the BLOB in an Oracle table to store IMG and document files. Now for= =20 Postgres(9.4.5), I have two options, i.e., BYTEA or OID. =C2=A0 With consideration of passing the params=C2=A0(SAVING) from the Java side a= s=20 follows: =C2=A0 DiskFileItemDeepy file =3D myFile; InputStream is =3D null; long fileSize = =3D 0; if=20 (file !=3D null && file.getFileSize() > 0){ =C2=A0=C2=A0=C2=A0=C2=A0 is =3D= file.getInputStream();=20 =C2=A0=C2=A0=C2=A0=C2=A0fileSize =3D file.getFileSize(); =C2=A0=C2=A0=C2=A0= =C2=A0call.setBinaryStream(1, (InputStream)is,=20 (long)fileSize); } ... call.execute();=20 =C2=A0 =C2=A0 //When retrieve the data use: =C2=A0 =C2=A0java.sql.Blob blob =3D (Blob) resultSet.getBlob(tableColumnName);=C2= =A0=20 =C2=A0 =C2=A0 For the purpose mentioned above, which Postgres data type is a better=20 candidate for replacement the BLOB,BYTEA or OID? =C2=A0