I have been using the new DBForge class to create databases automatically and for the most part things have been working well with a MySQL database. However, I recently tried a script with a PostgreSQL database (ver. 8.2.5) and found that there were several errors.
First of all, when trying to drop a table that does not exist, a critical error is thrown and the script exits. I believe this is because the “IF EXISTS” term does not work in PostgreSQL like it does in MySQL. I know I can do a simple check to see if the table exists before deleting it, but it would be nice if DBForge could simply ignore this error.
Also, The terminology for creating primary keys in a PostgreSQL database is off. DBForge tries to use the common “AUTO_INCREMENT” term for a primary key, but this also does not work in PostgreSQL. In PostgreSQL, there is a special datatype for an auto-incrementing value called “serial” that should be used.
I haven’t looked thoroughly through the PostgreSQL drivers in CI to see if there are any other issues, but these two are enough prevent me from using DBForge with PostgreSQL for now.
I’d like to use DBForge to create platform-independent installer scripts so I hope these issues are resolved in the near future.