Re: Oracke BLOB to Postgres BYTEA using ora2pg - Mailing list pgsql-general

From Peter J. Holzer
Subject Re: Oracke BLOB to Postgres BYTEA using ora2pg
Date
Msg-id 20190118193248.akpgyzrn5emajnee@hjp.at
Whole thread Raw
In response to RE: Oracke BLOB to Postgres BYTEA using ora2pg  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-general
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/>

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Why adding BEFORE TRIGGER affect client CPU?
Next
From: George Woodring
Date:
Subject: Re: Why adding BEFORE TRIGGER affect client CPU?