Re:
От | Gurudutt |
---|---|
Тема | Re: |
Дата | |
Msg-id | 882384001.20011221101935@indvalley.com обсуждение исходный текст |
Ответ на | ("Peter E. Chen" <pchen3@jhmi.edu>) |
Ответы |
Stored Procedure / Trigger Strangeness
|
Список | pgsql-general |
Hello Peter, Here is a complete procedure for converting from MySQL to PGSQL. You need to use two scripts a)my2pg.pl b)mysql2pgsql.pl ------------------PROCEDURE-------------------------- 1) Take the dump of the schema only mysqldump -d <YOURDBNAME> > /tmp/Tables.sql -p; 2) Convert this sql file into pgsql file using my2pg.pl perl my2pg.pl Tables.sql > TablesPg.sql 3) Take the dump of data mysqldump -c -t <YOURDBNAME> > /tmp/Data.sql -p; 4) Convert this sql file into pgsql file using mysql2pgsql.pl perl mysql2pgsql.pl Data.sql 5) step 4 will create a Data.sql92 file 6) find and replace all occurances of 0000-00-00 with 0001-01-01 using regular expression, if you have date field in your table structures 7) Start dumping to Postgres 8) create a database <YOURDBNAME> using createdb <YOURDBNAME> 9) Enter ACTBilling using psql <YOURDBNAME> --username=postgres 10) At the <YOURDBNAME> prompt type \i TablesPg.sql 11) All the tables will be successfully created. 12) Next use this command to port the data \i Data.sql92 13) All the data would be successfully ported. ---------------------END OF PROCEDURE--------------------- Hope it is of use to you. -- Best regards, Gurudutt mailto:guru@indvalley.com Life is not fair - get used to it. Bill Gates Thursday, December 20, 2001, 9:30:27 PM, you wrote: PEC> Hey All, PEC> Can anyone tell me where I can find documention on how to use mysql2pgsql? PEC> I downloaded the software conversion utility from www.pgsql.com. PEC> Thanks. PEC> Peter PEC> ---------------------------(end of broadcast)--------------------------- PEC> TIP 5: Have you checked our extensive FAQ? PEC> http://www.postgresql.org/users-lounge/docs/faq.html
В списке pgsql-general по дате отправления: