Well, I’m going to go ahead and post our solution to this problem anyway, in case someone in the future searches for this problem and finds this post. It would have helped us when we had this problem, that’s for sure.
The problem lays in the fact that the DataDirect driver verifies the type of database it is connecting to and it expects to connect to a Postgresql database, not an EnterpriseDB one. In order to check the version, when it connects to the database, it runs a function in the pg_catalog named version(), which returns a string indicating the type of database, as well as some information about the OS etc. In EnterpriseDB, for example, it will return something like ‘EnterpriseDB 9.2.1.3 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52), 64-bit’. From a true Postgres installation, it will return something like ‘PostgreSQL 8.3.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)’. The driver is looking for a string containing PostgreSQL. In order to get the DataDirect driver to work, you have to return it a string that indicates that it is connecting to a PostgreSQL installation. Here’s how we did that:
We created a new schema in each database to which we are connecting Data Services. We named it ‘force_datadirect_odbc_drivers_to_work’, but it isn’t important what you name it. We then created database Login Roles for use by Data Services and set the search_path variable for the Role to list that new schema first. For us, it looked like this ‘search_path = force_datadirect_odbc_drivers_to_work, pg_catalog, prod;’
Then we created a new version() function in the schema and defined it so that it returns ‘PostgreSQL 9.2’ (or whatever version you’re using). Basically, it’s overloading the version() function. So, when Data Services logs in using the new Role, it runs version(), but because of the search_path, it runs the new version(), thus getting a value it can live with.
This all requires some setup and maintenance, but it works. Hope it helps someone.
ht1815 (BOB member since 2008-05-23)