Re: how to extract data from bytea so it is be used in blob for mysql database

From: "George Kao" <george(dot)kao(at)group-upc(dot)com>
To: <rod(at)iol(dot)ie>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: how to extract data from bytea so it is be used in blob for mysql database
Date: 2009-05-14 19:07:02
Message-ID: 8552B77348994585BA4E4154E3323F10@nitrex.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for the replying.

The problem has been narrowed down to restoring a particular table with
Bytea field to Mysql database.
The data in escaped octal is not acceptable. Is there a way to dump the
bytea from posgresql database in hex format? I think it is acceptable by
mysql.exe.

George
-----Original Message-----
From: Raymond O'Donnell [mailto:rod(at)iol(dot)ie]
Sent: Thursday, May 14, 2009 2:14 PM
To: George Kao
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] how to extract data from bytea so it is be used in
blob for mysql database

On 14/05/2009 14:18, George Kao wrote:
> The platform is WinXP. I have database with fields of bytea in
> Posgresql 8.1. The objective was to transfer the entire databasae
> (schema + data) to Mysql 5.1. I used the pg_dump from Posgresql 8.1 to
> extract the schema and data. With some minor touch-up of the sql
> script generated, I am able to run the script with mysql.exe to store
> the database except for the bytea data...

OK, grand - but you still haven't said what problems you're running into. We
can't really help until you give a bit more detail.

Have you read up on the bytea type in the docs? When you do a text-format
dump, the data in bytea columns is dumped in escaped octal, so you need to
handle this somehow when reloading into MySQL.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2009-05-14 19:14:36 Re: how to extract data from bytea so it is be used in blob for mysql database
Previous Message Tom Lane 2009-05-14 18:45:07 Re: work_mem greater than 2GB issue