Re: Quick question MySQL --> PgSQL

From: dev(at)archonet(dot)com
To: josh(at)agliodbs(dot)com
Cc: sqllist <pgsql-sql(at)postgresql(dot)org>, Jeff MacDonald <jeff(at)pgsql(dot)com>
Subject: Re: Quick question MySQL --> PgSQL
Date: 2001-03-06 18:39:39
Message-ID: 20010306.18393900@client.archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 3/6/01, 5:26:18 PM, Josh Berkus <josh(at)agliodbs(dot)com> wrote regarding [SQL]
Quick question MySQL --> PgSQL:

> Folks,

> Just a quick question ... I need to do a regular transfer (daily +
on
> demand) of data from a MySQL database to a PostgreSQL database and back
> again. Can anybody steer me towards a good script for this, or do I
> have to write my own in PHP?

Don't think you'll find much off the shelf - this sort of thing tends to
be specific to each person and each project. It's just a matter of
SELECTing from MySQL and INSERTing into PostgreSQL in a loop. Be careful
with things like times and dates and if you are doing it in PHP make sure
you've thought about error recovery. I'd recommend copying into an import
table then when it's confirmed that's worked do an internal copy in PG.

Remember if it's run from a browser the user can just break the
connection. Consider running it from a cron-job with lynx or wget (or
write the thing in perl).

> Sorry to bother everyone with something that isn't strictly a SQL
> question, but I'm not sure where else to ask.

> -Josh Berkus

> P.S. If somebody wants consulting $$$ for the above, it may be
> available.

Sadly I charge in £££ and it doesn't sound like a large enough job to
make it worth mucking around with conversions.

- Richard Huxton

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message The Hermit Hacker 2001-03-06 18:42:49 Re: Quick question MySQL --> PgSQL
Previous Message pgsql-bugs 2001-03-06 18:17:03 Mis-firing of rules with a WHERE condition