pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
is there a mysql to postgresql sql converter?
8+ messages / 6 participants
[nested] [flat]

* is there a mysql to postgresql sql converter?
@ 2000-02-15 00:31  Clay <DrFrog@smartt.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Clay @ 2000-02-15 00:31 UTC (permalink / raw)
  To: pgsql-sql

if so id like to see it/have it!

if not is anyone interested in helping to make a script of some sort?


toodles




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [SQL] is there a mysql to postgresql sql converter?
@ 2000-02-15 12:17  Peter Eisentraut <e99re41@DoCS.UU.SE>
  parent: Clay <DrFrog@smartt.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Peter Eisentraut @ 2000-02-15 12:17 UTC (permalink / raw)
  To: Clay <DrFrog@smartt.com>; +Cc: pgsql-sql

On Mon, 14 Feb 2000, Clay wrote:

> if so id like to see it/have it!
> 
> if not is anyone interested in helping to make a script of some sort?

In all generality, this is a rather complex issue: converting the database
schemas (removing non-standard datatypes, such as enum), converting the
queries, plus converting the C code. As I understand it, their C API uses
some sort of "fetch next row" function, whereas we have a "get nth row"
call. So you'd also have to change the program logic. And that covers only
C, of course. Probably won't happen too soon.

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: is there a mysql to postgresql sql converter?
@ 2000-11-17 15:29  Clayton Cottingham <clayton@marketingchallenge.com>
  parent: Max Fonin <fonin@ziet.zhitomir.ua>
  1 sibling, 1 reply; 8+ messages in thread

From: Clayton Cottingham @ 2000-11-17 15:29 UTC (permalink / raw)
  To: Max Fonin <fonin@ziet.zhitomir.ua>; +Cc: DrFrog@smartt.com; 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@marketingchallenge.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
>  
>  




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: is there a mysql to postgresql sql converter?
@ 2000-11-17 21:17  Max Fonin <fonin@ziet.zhitomir.ua>
  0 siblings, 1 reply; 8+ messages in thread

From: Max Fonin @ 2000-11-17 21:17 UTC (permalink / raw)
  To: DrFrog@smartt.com; +Cc: 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.

Attachments:

  my2pg.pl (application/octet-stream, 4.2K) download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: is there a mysql to postgresql sql converter?
@ 2000-11-17 21:45  clayton cottingham <clayton@marketingchallenge.com>
  parent: Max Fonin <fonin@ziet.zhitomir.ua>
  0 siblings, 1 reply; 8+ messages in thread

From: clayton cottingham @ 2000-11-17 21:45 UTC (permalink / raw)
  To: Max Fonin <fonin@ziet.zhitomir.ua>; +Cc: DrFrog@smartt.com; 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



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: is there a mysql to postgresql sql converter?
@ 2000-11-17 23:13  Max Fonin <fonin@ziet.zhitomir.ua>
  parent: clayton cottingham <clayton@marketingchallenge.com>
  0 siblings, 2 replies; 8+ messages in thread

From: Max Fonin @ 2000-11-17 23:13 UTC (permalink / raw)
  To: clayton cottingham <clayton@marketingchallenge.com>; +Cc: DrFrog@smartt.com; pgsql-sql

Can give a link ?

On Fri, 17 Nov 2000 13:45:37 -0800
clayton cottingham <clayton@marketingchallenge.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



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: is there a mysql to postgresql sql converter?
@ 2000-11-18 12:08  Max Fonin <fonin@ziet.zhitomir.ua>
  parent: Max Fonin <fonin@ziet.zhitomir.ua>
  1 sibling, 0 replies; 8+ messages in thread

From: Max Fonin @ 2000-11-18 12:08 UTC (permalink / raw)
  To: Clayton Cottingham <clayton@marketingchallenge.com>; +Cc: 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;



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: Re: is there a mysql to postgresql sql converter?
@ 2001-01-23 02:28  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Clayton Cottingham <clayton@marketingchallenge.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Bruce Momjian @ 2001-01-23 02:28 UTC (permalink / raw)
  To: Clayton Cottingham <clayton@marketingchallenge.com>; +Cc: Max Fonin <fonin@ziet.zhitomir.ua>; DrFrog@smartt.com; 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@marketingchallenge.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@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2001-01-23 02:28 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-02-15 00:31 is there a mysql to postgresql sql converter? Clay <DrFrog@smartt.com>
2000-02-15 12:17 ` Peter Eisentraut <e99re41@DoCS.UU.SE>
2000-11-17 21:17 Re: is there a mysql to postgresql sql converter? Max Fonin <fonin@ziet.zhitomir.ua>
2000-11-17 21:45 ` clayton cottingham <clayton@marketingchallenge.com>
2000-11-17 23:13   ` Max Fonin <fonin@ziet.zhitomir.ua>
2000-11-17 15:29     ` Clayton Cottingham <clayton@marketingchallenge.com>
2001-01-23 02:28       ` Bruce Momjian <pgman@candle.pha.pa.us>
2000-11-18 12:08     ` Max Fonin <fonin@ziet.zhitomir.ua>

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