If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > PostgreSQL to MySQL conversion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: May 2003
Posts: 1
PostgreSQL to MySQL conversion

dont get me wrong - i love postgresql but sometimes, especialy on windows mysql is more practical....

I ve seen utilities like my2pg (mysql2postgresql) but none that would do the reverse. There are some tools that come with EMS PgManager that might aqctually do it - but they work with ADO databases only.

If you have any ideas, id love to hear them...
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Apr 2003
Location: Tunisia
Posts: 192
Thumbs up Just get the Mysql dump !!

U can really do it easy jump dump your postgresql dump , you must eliminate all trigers and stored procedures . if you're working under windows I'll advice you a very cool tool that access both postgresql and Mysql = http://www.dbtools.com.br
__________________
Open up
Take a look to my Blog http://www.rundom.com/karim2k

Last edited by karim2k; 05-19-03 at 10:29.
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: May 2002
Location: Florida, USA
Posts: 49
Actually in some ways it is easier to convert from PostgreSQL to MySQL than the other way around, because it is PostgreSQL that is the "strict" one. Many values which are allowable in MySQL will not be allowed in PostgreSQL, such as dates with 0000-00-00, etc...

So, if you just dump the basic table definitions, and remove ALL constraints (including the CHECK constraints you might use in a table def) you might be fine. (Foreign key constraints can be put back into place if you are using InnoDB, but I think they will have to use the simple REFERENCES syntax, rather than the CONSTRAINT syntax that you find in a PostgreSQL dump.

Also, of course, you will not be able to use any views, rules, domains, schemas, functions, user-defined operators, INTERVAL datatypes, or any of the other extra PostgreSQL datatypes. (...have I dismayed you yet? )

Oops... I just remembered; you will also have to remove all reference to PostgreSQL sequences and replace them with the auto_increment syntax in MySQL.

Basically, if your application has any complexity, DON'T convert it to MySQL. At least do yourself the favor of using SAPDB or Firebird SQL, both of which have windows versions (SAPDB actually supports almost all the same features as PostgreSQL).
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Apr 2003
Location: Tunisia
Posts: 192
Thumbs up Shell

I'll recommand you also to pipe a dump through out a direct dump or a text file while it has been retrived its' triggers and ...
__________________
Open up
Take a look to my Blog http://www.rundom.com/karim2k
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On