Why don't we just make sure the table is created with an integer type for the id column?  Seems like it would make the code cleaner.  It looks like DatabaseConnection::TABLES doesn't specify the id column, so perhaps the default column type on the id column is different in postgres.