Re: Problems with DB in 4.2.0
| From: | Tomas V.V.Cox | Date: | Wed, 10 Apr 2002 00:54:48 +0000 |
| Subject: | Re: Problems with DB in 4.2.0 | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-5288@lists.php.net to get a copy of this message | ||
Edin Kadribasic wrote:
>
> Any objections to commiting this fix to HEAD and MFHing into the release
> branch?
The DSN format was extended time ago. Now the correct format to connect
to Postgres via unix sockets is using:
pgsql://user:pass@unix()/db
Any way, please go ahead with the patch. Thanks,
Tomas V.V.Cox
> Index: pgsql.php
> ===================================================================
> RCS file: /repository/php4/pear/DB/pgsql.php,v
> retrieving revision 1.66
> diff -u -3 -p -r1.66 pgsql.php
> --- pgsql.php 12 Mar 2002 22:42:13 -0000 1.66
> +++ pgsql.php 9 Apr 2002 20:59:36 -0000
> @@ -88,7 +88,9 @@ class DB_pgsql extends DB_common
> $connstr = '';
>
> if ($protocol == 'tcp') {
> - $connstr = 'host=' . $dsninfo['hostspec'];
> + if ($dsninfo['hostspec']) {
> + $connstr = 'host=' . $dsninfo['hostspec'];
> + }
> if ($dsninfo['port']) {
> $connstr .= ' port=' . $dsninfo['port'];
> }
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php