MySQL -> Postgres dump converter

Lists: pgsql-generalpgsql-sql
From: Clayton Cottingham <clayton(at)marketingchallenge(dot)com>
To: Max Fonin <fonin(at)ziet(dot)zhitomir(dot)ua>
Cc: DrFrog(at)smartt(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: is there a mysql to postgresql sql converter?
Date: 2000-11-17 15:29:07
Message-ID: 200011172330.eAHNUUs75682@mail.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql


On Sat, 18 Nov 2000 01:13:23 +0200, Max Fonin said:

> Can give a link ?
>

can do :
http://freshmeat.net/projects/mysql2pgsql/?highlight=convert+sql

i havent tried their's

did try yours

it was nice to have the transactions!

> On Fri, 17 Nov 2000 13:45:37 -0800
> clayton cottingham <clayton(at)marketingchallenge(dot)com> wrote:
>
> > Max Fonin wrote:
> > >
> > > Hi.
> > >
> > > I'm writing MySQL->Postgres dump converter. E.g. it will convert only database dumps produced by mysqldump.
> > > It's almost ready, problems are ENUM and SET types. I have problems with types emulation.
> > > Maybe someone help me guys ?
> > >
> > > Anyway, some half-working version attached.
> > >
> > > Max Rudensky.
> > >
> > > ------------------------------------------------------------------------
> > > Name: my2pg.pl
> > > my2pg.pl Type: Perl Program (application/x-perl)
> > > Encoding: base64
> >
> >
> > thats cool!!
> >
> > i thought i saw another converter in the last couple o months on
> > freshmeat too
>
>


From: Max Fonin <fonin(at)ziet(dot)zhitomir(dot)ua>
To: DrFrog(at)smartt(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: is there a mysql to postgresql sql converter?
Date: 2000-11-17 21:17:34
Message-ID: 20001117231734.5ab5138c.fonin@ziet.zhitomir.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

Hi.

I'm writing MySQL->Postgres dump converter. E.g. it will convert only database dumps produced by mysqldump.
It's almost ready, problems are ENUM and SET types. I have problems with types emulation.
Maybe someone help me guys ?

Anyway, some half-working version attached.

Max Rudensky.

Attachment Content-Type Size
my2pg.pl application/octet-stream 4.2 KB

From: clayton cottingham <clayton(at)marketingchallenge(dot)com>
To: Max Fonin <fonin(at)ziet(dot)zhitomir(dot)ua>
Cc: DrFrog(at)smartt(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: is there a mysql to postgresql sql converter?
Date: 2000-11-17 21:45:37
Message-ID: 3A15A701.73E53846@marketingchallenge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

Max Fonin wrote:
>
> Hi.
>
> I'm writing MySQL->Postgres dump converter. E.g. it will convert only database dumps produced by mysqldump.
> It's almost ready, problems are ENUM and SET types. I have problems with types emulation.
> Maybe someone help me guys ?
>
> Anyway, some half-working version attached.
>
> Max Rudensky.
>
> ------------------------------------------------------------------------
> Name: my2pg.pl
> my2pg.pl Type: Perl Program (application/x-perl)
> Encoding: base64

thats cool!!

i thought i saw another converter in the last couple o months on
freshmeat too


From: Max Fonin <fonin(at)ziet(dot)zhitomir(dot)ua>
To: clayton cottingham <clayton(at)marketingchallenge(dot)com>
Cc: DrFrog(at)smartt(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: is there a mysql to postgresql sql converter?
Date: 2000-11-17 23:13:23
Message-ID: 20001118011323.0637fec4.fonin@ziet.zhitomir.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

Can give a link ?

On Fri, 17 Nov 2000 13:45:37 -0800
clayton cottingham <clayton(at)marketingchallenge(dot)com> wrote:

> Max Fonin wrote:
> >
> > Hi.
> >
> > I'm writing MySQL->Postgres dump converter. E.g. it will convert only database dumps produced by mysqldump.
> > It's almost ready, problems are ENUM and SET types. I have problems with types emulation.
> > Maybe someone help me guys ?
> >
> > Anyway, some half-working version attached.
> >
> > Max Rudensky.
> >
> > ------------------------------------------------------------------------
> > Name: my2pg.pl
> > my2pg.pl Type: Perl Program (application/x-perl)
> > Encoding: base64
>
>
> thats cool!!
>
> i thought i saw another converter in the last couple o months on
> freshmeat too


From: Max Fonin <fonin(at)ziet(dot)zhitomir(dot)ua>
To: Clayton Cottingham <clayton(at)marketingchallenge(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: is there a mysql to postgresql sql converter?
Date: 2000-11-18 12:08:47
Message-ID: 20001118140847.45895a34.fonin@ziet.zhitomir.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

Hi.

> > Can give a link ?
> can do :
> http://freshmeat.net/projects/mysql2pgsql/?highlight=convert+sql
Thank you.

BTW, if you interested in this tool, I may send you fresh versions or place it on the web.

Maybe you will or somebody help me with one problem ? Do you know PL/pgSQL and how to create new type in Postgres ?
The problem is that I can't use new type constructed with CREATE TYPE if transform functions written on PL/pgSQL.
Because PL/pgSQL doesn't support type "opaque", or I do something wrong. The same function on PL/pgSQL with
input argtype "text" or "int2" works fine, but when I simply change argtype to "opaque", I get "compilation error near line 0".
Source is below.

Thanks,
Max Rudensky.

BEGIN;

CREATE FUNCTION enum_access_Monday_in (opaque)
RETURNS enum_access_Monday
AS '
DECLARE
invalue ALIAS for $1;
BEGIN
IF invalue='''' OR invalue=''0'' THEN RETURN 0; END IF;
IF invalue=''Monday'' OR invalue=''1'' THEN RETURN 1; END IF;
IF invalue=''Tuesday'' OR invalue=''2'' THEN RETURN 2; END IF;
IF invalue=''Wednesday'' OR invalue=''3'' THEN RETURN 3; END IF;
RAISE EXCEPTION ''incorrect input value: %'',invalue;
END;'
LANGUAGE 'plpgsql'
WITH (ISCACHABLE);
CREATE FUNCTION enum_access_Monday_out (opaque)
RETURNS opaque
AS '
DECLARE
outvalue ALIAS for $1;
BEGIN
IF outvalue=0 THEN RETURN ''''; END IF;
IF outvalue=1 THEN RETURN ''Monday''; END IF;
IF outvalue=2 THEN RETURN ''Tuesday''; END IF;
IF outvalue=3 THEN RETURN ''Wednesday''; END IF;
RAISE EXCEPTION ''incorrect output value: %'',outvalue;
END;'
LANGUAGE 'plpgsql'
WITH (ISCACHABLE);

CREATE TYPE enum_access_Monday (
internallength = 2,
input = enum_access_Monday_in,
output = enum_access_Monday_out,
PASSEDBYVALUE
);

COMMIT;


From: Clayton Cottingham <clayton(at)marketingchallenge(dot)com>
To: Max Fonin <fonin(at)ziet(dot)zhitomir(dot)ua>
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: MySQL -> Postgres dump converter
Date: 2000-11-20 15:18:13
Message-ID: 200011202319.eAKNJts46362@mail.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql


On Tue, 21 Nov 2000 00:01:33 +0200, Max Fonin said:

> Hi.
>
> MySQL->Postgres dump converter is now available at http://ziet.zhitomir.ua/~fonin/code/my2pg.pl.
> Still beta and bugsome version but working, supports MySQL ENUMs, near the end are SET emulation.
> Please help me to test.
>
> Max Rudensky.
>
>

i just did a dump of one of our work tables and it produced a lot of functions
returned as opaque

..
which is ok, except i cant find said shared object anywhere on my sys

what is this part of?


From: Clayton Cottingham <clayton(at)marketingchallenge(dot)com>
To: Max Fonin <fonin(at)ziet(dot)zhitomir(dot)ua>
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: MySQL -> Postgres dump converter
Date: 2000-11-20 15:18:13
Message-ID: 200011202319.eAKNJts46363@mail.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql


On Tue, 21 Nov 2000 00:01:33 +0200, Max Fonin said:

> Hi.
>
> MySQL->Postgres dump converter is now available at http://ziet.zhitomir.ua/~fonin/code/my2pg.pl.
> Still beta and bugsome version but working, supports MySQL ENUMs, near the end are SET emulation.
> Please help me to test.
>
> Max Rudensky.
>
>

i just did a dump of one of our work tables and it produced a lot of functions
returned as opaque

..
which is ok, except i cant find said shared object anywhere on my sys

what is this part of?


From: Max Fonin <fonin(at)ziet(dot)zhitomir(dot)ua>
To: Clayton Cottingham <clayton(at)marketingchallenge(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: MySQL -> Postgres dump converter
Date: 2000-11-20 22:01:33
Message-ID: 20001121000133.6c3a9479.fonin@ziet.zhitomir.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql

Hi.

MySQL->Postgres dump converter is now available at http://ziet.zhitomir.ua/~fonin/code/my2pg.pl.
Still beta and bugsome version but working, supports MySQL ENUMs, near the end are SET emulation.
Please help me to test.

Max Rudensky.


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Clayton Cottingham <clayton(at)marketingchallenge(dot)com>
Cc: Max Fonin <fonin(at)ziet(dot)zhitomir(dot)ua>, DrFrog(at)smartt(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: Re: is there a mysql to postgresql sql converter?
Date: 2001-01-23 02:28:04
Message-ID: 200101230228.VAA29033@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql


FYI, 7.1 will have a MySQL dump converter in /contrib.

[ Charset ISO-8859-1 unsupported, converting... ]
>
> On Sat, 18 Nov 2000 01:13:23 +0200, Max Fonin said:
>
> > Can give a link ?
> >
>
> can do :
> http://freshmeat.net/projects/mysql2pgsql/?highlight=convert+sql
>
> i havent tried their's
>
> did try yours
>
> it was nice to have the transactions!
>
>
>
> > On Fri, 17 Nov 2000 13:45:37 -0800
> > clayton cottingham <clayton(at)marketingchallenge(dot)com> wrote:
> >
> > > Max Fonin wrote:
> > > >
> > > > Hi.
> > > >
> > > > I'm writing MySQL->Postgres dump converter. E.g. it will convert only database dumps produced by mysqldump.
> > > > It's almost ready, problems are ENUM and SET types. I have problems with types emulation.
> > > > Maybe someone help me guys ?
> > > >
> > > > Anyway, some half-working version attached.
> > > >
> > > > Max Rudensky.
> > > >
> > > > ------------------------------------------------------------------------
> > > > Name: my2pg.pl
> > > > my2pg.pl Type: Perl Program (application/x-perl)
> > > > Encoding: base64
> > >
> > >
> > > thats cool!!
> > >
> > > i thought i saw another converter in the last couple o months on
> > > freshmeat too
> >
> >
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Max Fonin <fonin(at)ziet(dot)zhitomir(dot)ua>
Cc: Clayton Cottingham <clayton(at)marketingchallenge(dot)com>, pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: MySQL -> Postgres dump converter
Date: 2001-01-23 02:29:50
Message-ID: 200101230229.VAA29105@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general pgsql-sql


FYI, we have a MySQL Perl script in 7.1beta. Would you please
check that and see if you have any enhancements? Thanks.

> Hi.
>
> MySQL->Postgres dump converter is now available at
> http://ziet.zhitomir.ua/~fonin/code/my2pg.pl. Still beta and
> bugsome version but working, supports MySQL ENUMs, near the end
> are SET emulation. Please help me to test.
>
> Max Rudensky.
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026