+ // https://secure.php.net/manual/en/function.pg-connect.php
+ $DSN = CONST_Database_DSN;
+ $DSN = preg_replace('/^pgsql:/', '', $DSN);
+ $DSN = preg_replace('/;/', ' ', $DSN);
+ $aDBInstances[$i] = pg_connect($DSN, PGSQL_CONNECT_FORCE_NEW);
+ pg_ping($aDBInstances[$i]);
+ }
+
+ for ($i = 0; $i < $iLoadThreads; $i++) {