pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: markw@mohawksoft.com
To: roji@mail15.com
Cc: pgsql-odbc@postgresql.org
Subject: Re: Convert database
Date: Fri, 3 Oct 2003 08:23:08 -0400 (EDT)
Message-ID: <49815.24.60.194.163.1065183788.squirrel@mail.mohawksoft.com> (raw)
In-Reply-To: <006a01c38991$3aa4d4d0$1500a8c0@deskpro>
References: <006a01c38991$3aa4d4d0$1500a8c0@deskpro>

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





view thread (3+ messages)

Message-ID: <49815.24.60.194.163.1065183788.squirrel@mail.mohawksoft.com>
Permalink:  ../49815.24.60.194.163.1065183788.squirrel@mail.mohawksoft.com/
Also on:    postgresql.org/message-id/49815.24.60.194.163.1065183788.squirrel@mail.mohawksoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: markw@mohawksoft.com, roji@mail15.com
  Subject: Re: Convert database
  In-Reply-To: <49815.24.60.194.163.1065183788.squirrel@mail.mohawksoft.com>
  References: <006a01c38991$3aa4d4d0$1500a8c0@deskpro> <49815.24.60.194.163.1065183788.squirrel@mail.mohawksoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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