[thelist] email server sql DB

Kelly Hallman khallman at wrack.org
Sun Nov 3 13:34:00 CST 2002

On Sun, 3 Nov 2002, Timothy J. Luoma wrote:
> On Sun, 3 Nov 2002 17:35:28 -0000, Andrew Maynes wrote:
> > presumably php has no problems and difference talking to postgres as
> > opposed to MySQl?

I'd say they both enjoy equal support in terms of PHP.

> I seem to remember someone mentioning something about an "abstraction
> layer" with PHP that basically would allow you to use the same PHP code
> with either MySQL or PG.

If PHP has postgres support enabled and mysql support is not enabled, you
could create shim functions named after the mysql_*() functions that
actually call the equivalent pg_*() functions.  It's nearly a 1-to-1
relationship, so that should be pretty easy.

Such an abstraction layer does not address the larger problem of switching
databases: the problem of differences in SQL implementations.  If your
application uses a lot of database-specific SQL functions or special
datatypes (like dates or monetary types) you may find you have a bit more
work to do in porting to a different database (regardless of whether the
target is postgres, Oracle, etc).

> I could be wrong, but I suspect that you may find more folks who are using
> MySQL and therefore more folks who can help with potential problems....

MySQL is probably the most popular database product in use.  Most open
source apps are more likely to support MySQL than any other database.
That is certainly a valid consideration.  However, if you are going to be
developing something from scratch, differences between the two are not
substantial and you may find the differences to be in postgres' favor.


More information about the thelist mailing list