pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Oracke BLOB to Postgres BYTEA using ora2pg
Date: Tue, 15 Jan 2019 11:12:29 +0200
Message-ID: <a6e10689-4353-fa77-2fdf-a522e000f5f3@matrix.gatewaynet.com> (raw)
In-Reply-To: <7d53972a39254292be7243d8fd06d53f@cewexch402.ad.cetin>
References: <7d53972a39254292be7243d8fd06d53f@cewexch402.ad.cetin>

Dobro jutro

On 15/1/19 10:39 π.μ., Mihalidesová Jana wrote:
>
> Hi,
>
> We try to migrate from oracle to postgres using ora2pg but we hit some weird behavior of bytea. Or it’s just our ignorance.
>
> Table migration were ok, but we are not able to read bytea data. What we did wrong.
>

Assuming your data are jpeg images,  try smth like :
psql -c "copy (select encode(serializable_value,'hex') from alf_node_properties_zaloha where serializable_value is not null LIMIT 1) to stdout" | xxd -p -r > foo.jpg

then use some program (gwenview) to see the image.

If you want to dump all images (assuming again we are dealing with images here), then loop over each row and do the same as above.

But it is essential that you know what those values represent. Are they pdf docs? images? binaries? octet-streams?

> Thank you for your help,
>
>

-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

view thread (10+ messages)  latest in thread

Message-ID: <a6e10689-4353-fa77-2fdf-a522e000f5f3@matrix.gatewaynet.com>
Permalink:  ../a6e10689-4353-fa77-2fdf-a522e000f5f3@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/a6e10689-4353-fa77-2fdf-a522e000f5f3@matrix.gatewaynet.com

 · 

reply

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: achill@matrix.gatewaynet.com
  Subject: Re: Oracke BLOB to Postgres BYTEA using ora2pg
  In-Reply-To: <a6e10689-4353-fa77-2fdf-a522e000f5f3@matrix.gatewaynet.com>
  References: <7d53972a39254292be7243d8fd06d53f@cewexch402.ad.cetin> <a6e10689-4353-fa77-2fdf-a522e000f5f3@matrix.gatewaynet.com>

* 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