Welcome Guest, Not a member yet? Register   Sign In
DBForge isn't working properly with PostgreSQL
#3

[eluser]James Gifford[/eluser]
I've made some changes to the database/drivers/postgre/postgre_forge.php file which address the problems I've encountered so far. These are just quick hacks to get the code working, I'm sure they could be made more efficient. I'm not sure where I should post my changes to postgre_forge.php, let me know if/how you would like them.

I'll summarize the issues I've found so far:

1. Postgres doesn't support the "IF NOT EXISTS" term when creating a table. The only workaround for this I could think of was to use the $this->db->table_exists() function to check for the table first.

2. When dropping a table, Postgres will throw an error if that table doesn't already exist. Adding "IF EXISTS" to the drop table query fixes this.

3. Postgres doesn't support unsigned integer data types. These types must be converted.

4. Postgres doesn't support all the same data types as MySQL such as tinyint. These types must be converted.

5. Postgres doesn't allow constraints with integer data types (eg: int(11)).

6. Perhaps the biggest difference is the treatment of auto-incrementing variables. Postgres has a special datatype called serial that handles these. The "AUTO INCREMENT" term is not supported.

7. Instead of "FOREIGN KEY" for non-primary keys Postgres uses "UNIQUE".

That's all I've found so far. I hope the changes I've made to the forge are useful. I haven't tested them fully, but they are working for me so far. I'll continue testing and searching for other errors.


Messages In This Thread
DBForge isn't working properly with PostgreSQL - by El Forum - 03-05-2008, 04:54 PM
DBForge isn't working properly with PostgreSQL - by El Forum - 03-05-2008, 09:39 PM
DBForge isn't working properly with PostgreSQL - by El Forum - 03-06-2008, 03:03 PM
DBForge isn't working properly with PostgreSQL - by El Forum - 03-06-2008, 07:23 PM
DBForge isn't working properly with PostgreSQL - by El Forum - 03-06-2008, 09:27 PM
DBForge isn't working properly with PostgreSQL - by El Forum - 11-05-2008, 05:32 PM
DBForge isn't working properly with PostgreSQL - by El Forum - 11-05-2008, 10:06 PM
DBForge isn't working properly with PostgreSQL - by El Forum - 08-05-2010, 04:02 PM
DBForge isn't working properly with PostgreSQL - by El Forum - 12-21-2010, 12:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB