MantisBT - TestLink
View Issue Details
0007058TestLinkDatabase Postgrespublic2015-04-14 16:152015-04-16 08:28
LinuxSuse Linux Enterprise Server12
1.9.13 (2015 #1) 
Postgresql 9.3
Firefox 36.0
0007058: Patch needed to install TestLink on Postgres db that uses Unix-domain socket
The Postgres database on Suse Enterprise Server communicates by default via a Unix-domain socket.

The postgres driver code in third_party/adodb/drivers/ tries to connect to the postgresql database with connection string "host='localhost' user='<testlink_db_user_name>' password='<testlink_db_user_pwd>' dbname='<testlink_db_name>'" .

When specifying the host= parameter, the connection is setup via tcp/ip. To connect via a domain socket, the host parameter must be omitted. So I needed the following hack to install and use testlink:

--- 2015-04-14 18:10:00.909754260 +0200
+++ 2015-04-14 18:13:39.913763647 +0200
@@ -694,7 +694,8 @@
                                $str .= str_repeat(' ',$ncnt);
- $this->_connectionID = pg_connect($str);
+ $domain_sock_str = preg_replace('/host=\'localhost\'/', '', $str);
+ $this->_connectionID = pg_connect($domain_sock_str);
                if ($this->_connectionID === false) return false;
                $this->Execute("set datestyle='ISO'");
Try to install TestLink 1.9.13 on a Postgres database that communicates via a Unix-domain socket.
No tags attached.
Issue History
2015-04-14 16:15winfrieddNew Issue
2015-04-14 16:39fmanNote Added: 0023085
2015-04-16 08:28winfrieddNote Added: 0023096

2015-04-14 16:39   
but this is not going to be added (yet) to stable code base, because it's patch to third party component
2015-04-16 08:28   
You shouldn't add the above patch. It's just a hack to get my situation working. When applying the above patch, connecting to a psql daemon that uses a tcp/ip socket won't work anymore.

I think the install web page where you select the database type should have an option to indicate if the database is communicating via a domain socket.