I Was up until 3am this morning, I’ve got the programming bug I guess! I’ve downloaded a lot more ebooks too.

I converted my DVD database to PostgreSQL. It wasn’t actually that difficult, I just changed the following:

PHP:
mysql_connect to pg_connect
mysql_fetch_array to pg_fetch_array
mysql_query changed to pg_query

SQL:
LIMIT x,y changed to LIMIT y OFFSET x
NULL changed to DEFAULT on the serial column

Schema:
auto_increment column changed to serial

It would be quite easy to make a wrapper around the database calls, kinda like Perl’s DBI::DBD module, don’t know why PHP doesn’t have this, I’ve seen lack of database abstraction as a criticism a few times.

I managed to change a mysqldump into a load of SQL commands using some cunning regexes, and created the database using the quite nice pgamin3