From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Oracke BLOB to Postgres BYTEA using ora2pg
Date: Fri, 18 Jan 2019 20:32:48 +0100
Message-ID: <20190118193248.akpgyzrn5emajnee@hjp.at> (raw)
In-Reply-To: <fa5311f7-586b-4c60-9a2c-e047f1a47259@manitou-mail.org>
References: <f6203fc419dd4b48b0289037e788a3df@cewexch402.ad.cetin>
<fa5311f7-586b-4c60-9a2c-e047f1a47259@manitou-mail.org>
On 2019-01-15 12:56:05 +0100, Daniel Verite wrote:
> Mihalidesová Jana wrote:
> > nipjd=> select distinct encode(serializable_value, 'escape') from
> > alf_node_properties_zaloha where serializable_value is not null;
> > encode
> > --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> > decode(E'aced00057e72002c6f72672e616c66726573636f2e736572766963652e636d722e76657273696f6e2e56657273696f6e5479706500000000000000001200007872000e6a6176612e6c616e672e456e756d000000000000000012000078707400054d494e4f52',
> > 'hex')
>
> 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
--
_ | 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 <https://www.edge.org/;
Attachments:
signature.asc (application/pgp-signature, 832B) download
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: hjp-pgsql@hjp.at
Subject: Re: Oracke BLOB to Postgres BYTEA using ora2pg
In-Reply-To: <20190118193248.akpgyzrn5emajnee@hjp.at>
References: <f6203fc419dd4b48b0289037e788a3df@cewexch402.ad.cetin> <fa5311f7-586b-4c60-9a2c-e047f1a47259@manitou-mail.org> <20190118193248.akpgyzrn5emajnee@hjp.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox