Re: DB Error: connect failed [SOLVED]

From: "Rodolfo J(dot) Paiz" <rpaiz(at)simpaticus(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: DB Error: connect failed [SOLVED]
Date: 2005-02-03 15:38:25
Message-ID: 1107445105.5220.13.camel@rodolfo.gt.factorrent.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, 2005-02-03 at 01:42 -0500, Tom Lane wrote:
> Dunno about phpPgAdmin, but psql defaults to connecting through a Unix
> socket, which doesn't have either of the above risks.
>

I *thought* I was connecting to the Unix socket, so of course such a
thing should not have been a problem. I went back to the DSN array I had
written after your message and (after a little trial and error) figured
out to add "'protocol' => 'unix'" as one of the values in the array. The
final (working) DSN array and connect process was:

$dsn = array('phptype' => 'pgsql',
'username' => 'simpatic_www',
'password' => 'gottago',
'protocol' => 'unix',
'hostspec' => 'localhost',
'database' => 'simpatic_logbook'
);
$options = array('debug' => 2,
'portability' => DB_PORTABILITY_ALL
);
$db =& DB::connect($dsn, $options);
if (DB::isError($db)) { die($db->getMessage()); }

The connect *appears* to have worked fine, since I then get a page with
no database output (I've made no queries) but also no errors. So I'm
guessing the connect is done... thanks!

Of course, everything immediately broke again when I tried a query. But
after a little time with the PEAR manual, and googling for bizarre
errors I would never have expected, the thing works. I have a simple
query that returns one value, but it's working! I now have only two
small details that pique my curiosity:

1. What is "debug=2" and do I need it? Happy to RTFM... URL to FM?

2. What is the significance of "=&" instead of "="? I can't find an
explanation anywhere.

My thanks to everyone who has helped me get over this first hump in my
PostgreSQL usage.

--
Rodolfo J. Paiz <rpaiz(at)simpaticus(dot)com>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2005-02-03 16:29:04 Re: Can't change LC_CTYPE/locale
Previous Message Schuhmacher, Bret 2005-02-03 15:28:37 Can't change LC_CTYPE/locale