X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 64FCDD1B50F for ; Fri, 3 Oct 2003 12:09:35 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 30410-09 for ; Fri, 3 Oct 2003 09:08:48 -0300 (ADT) Received: from outland.mohawksoft.com (unknown [64.46.156.80]) by svr1.postgresql.org (Postfix) with ESMTP id DAB61D1B4E3 for ; Fri, 3 Oct 2003 09:08:40 -0300 (ADT) Received: (from mohawk@localhost) by outland.mohawksoft.com (8.11.6/8.9.3) id h93CN9932120; Fri, 3 Oct 2003 08:23:09 -0400 X-Authentication-Warning: outland.mohawksoft.com: mohawk set sender to markw@mohawksoft.com using -f Received: from 24.60.194.163 (SquirrelMail authenticated user markw) by mail.mohawksoft.com with HTTP; Fri, 3 Oct 2003 08:23:08 -0400 (EDT) Message-ID: <49815.24.60.194.163.1065183788.squirrel@mail.mohawksoft.com> Date: Fri, 3 Oct 2003 08:23:08 -0400 (EDT) Subject: Re: Convert database From: To: In-Reply-To: <006a01c38991$3aa4d4d0$1500a8c0@deskpro> References: <006a01c38991$3aa4d4d0$1500a8c0@deskpro> X-Priority: 3 Importance: Normal Cc: X-Mailer: SquirrelMail (version 1.2.10) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/27 X-Sequence-Number: 3340 > How to convert from MySQL to PostgreSQL. > I tried using DBTools, but to slowly. Converting 1 row taken around 0.25 > second!!!! Because i have database over 100MB on MySQL. Maybe over 3 > days non-stop to converting. Is there another way? I'm tried to using > my2pg and mysql2pgsql. But error occured. I want to migrate to > PostgreSQL 'cause i have a problem on MySQL.' MySQL doesn't support sub > select on stable version (4.0.14) and too slow sub select query on alpha > version (4.1.0). Is PostgreSQL support that features? How fast it can > execute? Sub-selects rock on postgresql. I use them extensively. In fact I would never use MySQL, and that is just one of the reasons. Anyway, to import, if you are handy without a GUI, there may be a way to do it quickly. This is what I do when I migrate SQL data from one source to another. (It have done this quite often between MSSQL, PostgreSQL, and Oracle...Like I said, I wouldn't use MySQL) Dump out the schema from the database if you don't already have it as a SQL script. Separate the table definitions from the index/trigger definitions. Create the tables in PostgreSQL usinhg the SQL schema. Make any changes to the data types as nessisary. Using what ever tool exists in your current SQL environment, dump out a tab-delimited file for each table. Using postgreSQL's "COPY" syntax, copy the data to the table from the dump file. Hint, you have PHP and you know how to use it, it is trivial to open a MySQL and a PostgreSQL connection at the same time, query all records from MySQL database and "COPY" them to PostgreSQL. I have two databases, one Oracle and one PostgreSQL. The PostgreSQL works on a snapshot of the Oracle database. The snapshot is updated every week. The table has 26 million records in it. I don't remember how long it takes, but it isn't an unreasonable amount of time.