Re: Porting MySQL PHP to Postgres - Mailing list pgsql-general

From Matt Kynaston
Subject Re: Porting MySQL PHP to Postgres
Date
Msg-id 4219C845.6080401@kynx.org
Whole thread Raw
In response to Re: Porting MySQL PHP to Postgres  (Shaun Clements <ShaunC@relyant.co.za>)
List pgsql-general
Shaun Clements wrote:

I assumed as much. I was hoping there was a tool available which someone had used and (or) what kind of stumbling blocks to run into. There's useful articles at:
http://www.sitepoint.com/article/site-mysql-postgresql-1/2
http://www.raditha.com/postgres/
and a mysql2pgsql script (that I've never tried) at:
http://www.raditha.com/blog/archives/000497.html

In the PHP code itself, mysql_insert_id() is a big one with no direct equivalent.

Since it's an intranet app, the overhead of using one of the abstraction layers like DB or MDB might not be a huge problem. It'd make stuff like the above easier:
http://pear.php.net/packages.php?catpid=7&catname=Database

Or if you're on PHP5 and feel like catching a few bugs, check out PDO:
http://pecl.php.net/package/PDO

In the SQL, watch out for GROUP BYs without all column names used in the SELECT specified and the syntax of LIMIT. And I'm sure there's other gotchas I can't remember. But on the whole you should find Postgres is able to do far more things (like UNION, unavail in older version of MySQL): if you've got the time it'd probably pay to rethink some of the brain-dead things That Other RDBMS (TM) makes you do.

Enjoy!

Matt

pgsql-general by date:

Previous
From: Martín Marqués
Date:
Subject: Re: change user password
Next
From: "mef"
Date:
Subject: Tracing of tables deleting - how?