pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: scott.marlowe <scott.marlowe@ihs.com>
To: Michael Hanna <taojones@sympatico.ca>
Cc: pgsql-php@postgresql.org
Subject: Re: Can't connect to 7.4 DB
Date: Thu, 12 Feb 2004 08:30:17 -0700 (MST)
Message-ID: <Pine.LNX.4.33.0402120827550.4413-100000@css120.ihs.com> (raw)
In-Reply-To: <80431890-5D60-11D8-B81E-000A95B34330@sympatico.ca>

OK, here's a little trick you may not be aware of.

pg_connect("dbname=mydb user=stan");

will open a local unix domain socket.

pg_connect("host=127.0.0.1 dbname=mydb user=stan");

will open a local TCP/IP connection on the loopback interface.

In order for this to work, your postgresql.conf must have this line 
changed:
#tcpip_socket = false
to
tcpip_socket = true

and your pg_hba.conf needs a line like this:

host    all         all         127.0.0.1         255.0.0.0   trust

So it's likely the "secure by default" mentality of postgresql that's 
biting you here.




view thread (4+ messages)  latest in thread

Message-ID: <Pine.LNX.4.33.0402120827550.4413-100000@css120.ihs.com>
Permalink:  ../Pine.LNX.4.33.0402120827550.4413-100000@css120.ihs.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.33.0402120827550.4413-100000@css120.ihs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: scott.marlowe@ihs.com, taojones@sympatico.ca
  Subject: Re: Can't connect to 7.4 DB
  In-Reply-To: <Pine.LNX.4.33.0402120827550.4413-100000@css120.ihs.com>
  References: <80431890-5D60-11D8-B81E-000A95B34330@sympatico.ca> <Pine.LNX.4.33.0402120827550.4413-100000@css120.ihs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox