Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkZst-0000He-QU for pgsql-general@arkaria.postgresql.org; Fri, 18 Jan 2019 19:32:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gkZss-0005SJ-CS for pgsql-general@arkaria.postgresql.org; Fri, 18 Jan 2019 19:32:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkZss-0005SC-4r for pgsql-general@lists.postgresql.org; Fri, 18 Jan 2019 19:32:54 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkZsp-0001Dx-Af for pgsql-general@lists.postgresql.org; Fri, 18 Jan 2019 19:32:53 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 773942445; Fri, 18 Jan 2019 20:32:48 +0100 (CET) Date: Fri, 18 Jan 2019 20:32:48 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Oracke BLOB to Postgres BYTEA using ora2pg Message-ID: <20190118193248.akpgyzrn5emajnee@hjp.at> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="txz2eymjykdeazb3" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --txz2eymjykdeazb3 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-01-15 12:56:05 +0100, Daniel Verite wrote: > Mihalidesov=E1 Jana wrote: > > nipjd=3D> select distinct encode(serializable_value, 'escape') from > > alf_node_properties_zaloha where serializable_value is not null;=20 > > = encode > > -----------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= --- > > decode(E'aced00057e72002c6f72672e616c66726573636f2e736572766963652e636d= 722e76657273696f6e2e56657273696f6e5479706500000000000000001200007872000e6a6= 176612e6c616e672e456e756d000000000000000012000078707400054d494e4f52', > > 'hex')=20 >=20 > These contents are code, in the form of function calls, instead of data. I doubt this (code in what language?). Since the column name is "serializable_value" and there are what looks like Java class names embedded in the blob ("org.alfresco.service.cmr.version.VersionType", "java.lang.Enum", ...) these are most likely Java objects in java serialization format. The OP should be able to deserialize them with Java. I would expect the JDBC to return a proper byte array (or maybe a ByteBuffer). That the field looks different (hex in psql, raw in sqlplus) is most likely a red herring - that's just for the benefit of humans, but humans can't read binary data directly. hp --=20 _ | Peter J. Holzer | we build much bigger, better disasters now |_|_) | | because we have much more sophisticated | | | hjp@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson --txz2eymjykdeazb3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAlxCKdsACgkQ8g5IURL+ KF01AA//YAEY4SGrF7mP6p0hML3v2jFdLh+fhMxxtP+D/l7FGwgWxIUsrjswzDWH csxMtcATic3aMcIWJglTWj2IaGYVRDLkxMuR5fC+ANeeX/DT/S6a8TxOhpq6NZNS yYNpJnd87WWWFCRx9Immi/SOzHfU9/b1Lt0apxu6cPQiLkOERHh8kTBXCCBS0fzN vBpKQeoZbcvXEy0At3Ht/jtNpgZg5RiHLDGIcEbnIMn1z491Wuwog43vG4YKgDgc q+69OF7q8O8mdXOeCBwrwccPLDljnpRJ7e3yEf+sH5HeMI26QPA3Pg7OqmEd5wrr WMJu7t7Et1XaBEOfbusyXnPv/IA+0uNNl8UFS0O4QhKmYO8rniO5Cq5cP8CNmlsH CPMVgtB+Vj8EZ42+EZSYEDNU92v3lwnS4952Plz9r/5bX6kuRPP0m76eicOflmNt n1MgxpzqaZuuOPkADxbhRsM1N8PtTaz0iH+UJcad2AFMPQlUFj3hYUU9LtC2M4sM M9esKzRkekm/sD1WrT0uNTZdSCP5dHQ9RgQF+uzohyV8H133WZpUe2wfQUOYAs63 xQwRk115B0pGpXszuroQtBmxPJ6Fp773ro8DO8tp73HyhsvIDlK3uRWZJCYhS1BR A/VR85jz5VsYTVAS65B90QH/3+lgE6WVroNR0S2oKH4Dl2EUwIs= =76vm -----END PGP SIGNATURE----- --txz2eymjykdeazb3--