Re: [GENERAL] MySQL -> Postgres dump converter

Started by Max Rudenskyalmost 25 years ago9 messages
#1Max Rudensky
fonin@ziet.zhitomir.ua
3 attachment(s)

Bruce,

On Tue, 23 Jan 2001 09:35:49 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us> wrote:

We used someone elses. Here is a copy. Please submit any patches
against this version.

Sucks found:
- doesn't handle mediumint, converts it to mediuminteger.
The same for bigint, and probably shorting & tinyint as well.
I don't know whether 7.1 release has such type but even if yes
more preferrable to keep compatibility with old releases (7.0.x doesn't have, right ?)
- it doesn't handle mysql UNIQUE (that is keyword for unique index) inside CREATE TABLE block
- better to create indices after data load (it does before)
- doesn't handle UNSIGNED keyword (should a least skip it, or, at user option, convert to CHECK(field>=0))
- doesn't convert AUTO_INCREMENT in right way, at least in my production database.

I don't see conversion of MySQL's SET and ENUM types.

Well, before do any improvements on mysql2pgsql, I want to inform you that my
converter has all features described above. Maybe it's easier to modify it to fit your requirements ?
At least take a look at it.
I don't like to do the same work twice, and this one promises to be exactly so.

Sending you my MySQL db dump which I used to play with it.

Max Rudensky.

Attachments:

test.initapplication/octet-stream; name=test.initDownload
test.mysqlapplication/octet-stream; name=test.mysqlDownload
test.sql92application/octet-stream; name=test.sql92Download
#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Max Rudensky (#1)

Can some PostgreSQL people comment on this? This person wrote a
MySQL->PostgreSQL converter too. His version is at:

http://ziet.zhitomir.ua/~fonin/code

Bruce,

On Tue, 23 Jan 2001 09:35:49 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us> wrote:

We used someone elses. Here is a copy. Please submit any patches
against this version.

Sucks found:
- doesn't handle mediumint, converts it to mediuminteger.
The same for bigint, and probably shorting & tinyint as well.
I don't know whether 7.1 release has such type but even if yes
more preferrable to keep compatibility with old releases (7.0.x doesn't have, right ?)
- it doesn't handle mysql UNIQUE (that is keyword for unique index) inside CREATE TABLE block
- better to create indices after data load (it does before)
- doesn't handle UNSIGNED keyword (should a least skip it, or, at user option, convert to CHECK(field>=0))
- doesn't convert AUTO_INCREMENT in right way, at least in my production database.

I don't see conversion of MySQL's SET and ENUM types.

Well, before do any improvements on mysql2pgsql, I want to inform you that my
converter has all features described above. Maybe it's easier to modify it to fit your requirements ?
At least take a look at it.
I don't like to do the same work twice, and this one promises to be exactly so.

Sending you my MySQL db dump which I used to play with it.

Max Rudensky.

[ Attachment, skipping... ]

[ Attachment, skipping... ]

[ Attachment, skipping... ]

-- 
  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
#3Thomas Lockhart
lockhart@alumni.caltech.edu
In reply to: Bruce Momjian (#2)

Can some PostgreSQL people comment on this? This person wrote a
MySQL->PostgreSQL converter too. His version is at:
http://ziet.zhitomir.ua/~fonin/code

-- THIS VERSION IS EXTREMELY BUGSOME ! USE IT ON YOUR OWN RISK !!!

Hmm. My version does not have this feature, but it could be added ;)

Seriously, I haven't looked at the differences, but there is a licensing
difference (BSD vs GPL). Someone else with experience with MySQL should
evaluate both packages.

mysql2pgsql has been used to convert SourceForge, with ~90 tables and
moderately complicated schema, but that did not include enumerated types
(done with ints at SF) and "unique" keys (done with sequences at SF)
afaicr.

Sucks found:...

Each is a one-liner to fix in mysql2pgsql. The (nonstandard) types
mentioned weren't used in the test cases I had available. I didn't
realize that we had *any* reports of troubles or lacking features in the
existing converter, but I'll leave it up to y'all to decide if the
licensing issues and feature issues are significant.

I'm willing to provide patches to address some of the concerns, but of
course will not be able to look at the GPL'd code for hints and can only
use the information posted here to help afaik.

Comments?

- Thomas

#4Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Thomas Lockhart (#3)

Can someone look at both versions and merge the improvements into our
version? Should be pretty easy.

Can some PostgreSQL people comment on this? This person wrote a
MySQL->PostgreSQL converter too. His version is at:
http://ziet.zhitomir.ua/~fonin/code

-- THIS VERSION IS EXTREMELY BUGSOME ! USE IT ON YOUR OWN RISK !!!

Hmm. My version does not have this feature, but it could be added ;)

Seriously, I haven't looked at the differences, but there is a licensing
difference (BSD vs GPL). Someone else with experience with MySQL should
evaluate both packages.

mysql2pgsql has been used to convert SourceForge, with ~90 tables and
moderately complicated schema, but that did not include enumerated types
(done with ints at SF) and "unique" keys (done with sequences at SF)
afaicr.

Sucks found:...

Each is a one-liner to fix in mysql2pgsql. The (nonstandard) types
mentioned weren't used in the test cases I had available. I didn't
realize that we had *any* reports of troubles or lacking features in the
existing converter, but I'll leave it up to y'all to decide if the
licensing issues and feature issues are significant.

I'm willing to provide patches to address some of the concerns, but of
course will not be able to look at the GPL'd code for hints and can only
use the information posted here to help afaik.

Comments?

- Thomas

-- 
  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
#5Max Rudensky
fonin@ziet.zhitomir.ua
In reply to: Bruce Momjian (#4)

Guys,

Thomas said he won't look into GPL'ed code for ideas.
Well, I re-read GPL and found that it's up to author whether is to allow or not
to use code for using in programs with another open-source license. So this isn't
a problem - you may use my program and include code to your without limitations.
I even would prefer to change license to BSD or similar
but I didn't find in GPL ideas about that.

Max Rudensky.

On Wed, 24 Jan 2001 11:06:12 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us> wrote:

Show quoted text

Can someone look at both versions and merge the improvements into our
version? Should be pretty easy.

Can some PostgreSQL people comment on this? This person wrote a
MySQL->PostgreSQL converter too. His version is at:
http://ziet.zhitomir.ua/~fonin/code

-- THIS VERSION IS EXTREMELY BUGSOME ! USE IT ON YOUR OWN RISK !!!

Hmm. My version does not have this feature, but it could be added ;)

Seriously, I haven't looked at the differences, but there is a licensing
difference (BSD vs GPL). Someone else with experience with MySQL should
evaluate both packages.

mysql2pgsql has been used to convert SourceForge, with ~90 tables and
moderately complicated schema, but that did not include enumerated types
(done with ints at SF) and "unique" keys (done with sequences at SF)
afaicr.

Sucks found:...

Each is a one-liner to fix in mysql2pgsql. The (nonstandard) types
mentioned weren't used in the test cases I had available. I didn't
realize that we had *any* reports of troubles or lacking features in the
existing converter, but I'll leave it up to y'all to decide if the
licensing issues and feature issues are significant.

I'm willing to provide patches to address some of the concerns, but of
course will not be able to look at the GPL'd code for hints and can only
use the information posted here to help afaik.

Comments?

- Thomas

-- 
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
#6Max Rudensky
fonin@ziet.zhitomir.ua
In reply to: Thomas Lockhart (#3)
Re: Re: [GENERAL] MySQL -> Postgres dump converter

On 27 Jan 2001 11:25:56 +0100
Adrian Phillips <adrianp@powertech.no> wrote:

"Max" == Max Rudensky <fonin@ziet.zhitomir.ua> writes:

Max> Guys, Thomas said he won't look into GPL'ed code for ideas.
Max> Well, I re-read GPL and found that it's up to author whether
Max> is to allow or not to use code for using in programs with
Max> another open-source license. So this isn't a problem - you
Max> may use my program and include code to your without
Max> limitations. I even would prefer to change license to BSD or
Max> similar but I didn't find in GPL ideas about that.

If you are the original author and have not had large contributions to
it then its just a matter of rereleasing as BSD, if on the other hand
others have contributed then you'll have to get permission from them.

Yes, I wrote it, and I'd like to re-release it to other from GPL license.

Show quoted text

Sincerely,

Adrian Phillips

--
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now? [OK]

#7Hannu Krosing
hannu@tm.ee
In reply to: Thomas Lockhart (#3)
Re: Re: [GENERAL] MySQL -> Postgres dump converter

Max Rudensky wrote:

Guys,

Thomas said he won't look into GPL'ed code for ideas.
Well, I re-read GPL and found that it's up to author whether is to allow or not
to use code for using in programs with another open-source license. So this isn't
a problem - you may use my program and include code to your without limitations.
I even would prefer to change license to BSD or similar
but I didn't find in GPL ideas about that.

If it's all your code, then you are free to license it under any licence
you desire.

You are completely free to licence it under both GPL and BSD licenses at
the same time.

You can even simultaneously license it under a commercial licence if you
want to ;)

What you probably can't do is to revoke the GPL license.

-----------
Hannu

#8Oliver Elphick
olly@lfix.co.uk
In reply to: Hannu Krosing (#7)
Re: Re: [GENERAL] MySQL -> Postgres dump converter

Hannu Krosing wrote:

If it's all your code, then you are free to license it under any licence
you desire.

...

What you probably can't do is to revoke the GPL license.

You can't revoke it from existing copies "out there", but you can from any
copies you release from now on, even of the same code..

--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Many are the afflictions of the righteous; but the
LORD delivereth him out of them all."
Psalm 34:19

#9Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Thomas Lockhart (#3)

OK, I have added this conversion scripts to CVS along with Thomas's. If
someone wants to merge them into one, feel free to submit a patch. I
have provided a URL to my2pg.pl to retrieve the most recent version.

The only license issue was that the bottom of the source code had a
mention referring to the GPL for more information. I removed that
because it now clearly states it has a BSD-like license.

Thanks.

Can some PostgreSQL people comment on this? This person wrote a
MySQL->PostgreSQL converter too. His version is at:
http://ziet.zhitomir.ua/~fonin/code

-- THIS VERSION IS EXTREMELY BUGSOME ! USE IT ON YOUR OWN RISK !!!

Hmm. My version does not have this feature, but it could be added ;)

Seriously, I haven't looked at the differences, but there is a licensing
difference (BSD vs GPL). Someone else with experience with MySQL should
evaluate both packages.

mysql2pgsql has been used to convert SourceForge, with ~90 tables and
moderately complicated schema, but that did not include enumerated types
(done with ints at SF) and "unique" keys (done with sequences at SF)
afaicr.

Sucks found:...

Each is a one-liner to fix in mysql2pgsql. The (nonstandard) types
mentioned weren't used in the test cases I had available. I didn't
realize that we had *any* reports of troubles or lacking features in the
existing converter, but I'll leave it up to y'all to decide if the
licensing issues and feature issues are significant.

I'm willing to provide patches to address some of the concerns, but of
course will not be able to look at the GPL'd code for hints and can only
use the information posted here to help afaik.

Comments?

- Thomas

-- 
  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