Thread: running pgaccess on localhost

running pgaccess on localhost

From
"Mike Goetz"
Date:
Hello, pgsql newbie here...

I'm trying to run pgaccess on a database I've created, and I get the
following error:

PostgreSQL error message: Connection to database failed
PQconnectPoll() -- connect() failed: Connection refused
Is the postmaster running (with -i) at 'localhost' and accepting
connections on TCP/IP port '5432'?

Now the postmaster is not normally set up with the -i option, and I'd like
to keep it that way since I'm intending to use my workstation for local
development only (are there any security issues by activating the -i
option?).  Indeed turning the -i option on does in fact allow me to use
pgaccess without error.

However, since I'm running pgaccess from a terminal window on my machine I
would have thought that this would constitute a local domain socket
connection (or at least a connection from the localhost), so I'm confused
by the error message -- am I missing something or do I really have to
enable TCP/IP connections if I want to initiate database access using
pgacess from a terminal window?

Mike

[running postgreSQL 7.0 on Linux-Mandrake with kernel 2.4.3]

Re: running pgaccess on localhost

From
Joel Burton
Date:
On Fri, 27 Apr 2001, Mike Goetz wrote:

> Hello, pgsql newbie here...
>
> I'm trying to run pgaccess on a database I've created, and I get the
> following error:
>
> PostgreSQL error message: Connection to database failed
> PQconnectPoll() -- connect() failed: Connection refused
> Is the postmaster running (with -i) at 'localhost' and accepting
> connections on TCP/IP port '5432'?
>
> Now the postmaster is not normally set up with the -i option, and I'd like
> to keep it that way since I'm intending to use my workstation for local
> development only (are there any security issues by activating the -i
> option?).  Indeed turning the -i option on does in fact allow me to use
> pgaccess without error.
>
> However, since I'm running pgaccess from a terminal window on my machine I
> would have thought that this would constitute a local domain socket
> connection (or at least a connection from the localhost), so I'm confused
> by the error message -- am I missing something or do I really have to
> enable TCP/IP connections if I want to initiate database access using
> pgacess from a terminal window?

The fact that you're running pgaccess from a term window doesn't mean that
pgaccess connects to PG w/a local socket.

Someone may know how to configure pgaccess to use a local socket. If not,
use the -i switch, and edit $PGDATA/pg_hba.conf to block access from other
machines. (This is the default setting.)



--
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington


Re: Re: running pgaccess on localhost

From
"Oliver Elphick"
Date:
Joel Burton wrote:
  >On Fri, 27 Apr 2001, Mike Goetz wrote:

  >> I'm trying to run pgaccess on a database I've created, and I get the
  >> following error:
  >>
  >> PostgreSQL error message: Connection to database failed
  >> PQconnectPoll() -- connect() failed: Connection refused
  >> Is the postmaster running (with -i) at 'localhost' and accepting
  >> connections on TCP/IP port '5432'?

  >The fact that you're running pgaccess from a term window doesn't mean that
  >pgaccess connects to PG w/a local socket.
  >
  >Someone may know how to configure pgaccess to use a local socket. If not,
  >use the -i switch, and edit $PGDATA/pg_hba.conf to block access from other
  >machines. (This is the default setting.)

When pgaccess's connection dialog appears, remove any entry from the
host field.  If this is empty, pgaccess will connect through the Unix socket;
if it has anything at all in it, it will use TCP/IP.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Draw nigh to God, and he will draw nigh to you.
      Cleanse your hands, ye sinners; and purify your
      hearts, ye double minded."        James 4:8



Re: running pgaccess on localhost

From
"Eric G. Miller"
Date:
On Fri, Apr 27, 2001 at 08:24:53AM +0000, Mike Goetz wrote:
> Hello, pgsql newbie here...
>
> I'm trying to run pgaccess on a database I've created, and I get the
> following error:
>
> PostgreSQL error message: Connection to database failed
> PQconnectPoll() -- connect() failed: Connection refused
> Is the postmaster running (with -i) at 'localhost' and accepting
> connections on TCP/IP port '5432'?
>
> Now the postmaster is not normally set up with the -i option, and I'd like
> to keep it that way since I'm intending to use my workstation for local
> development only (are there any security issues by activating the -i
> option?).  Indeed turning the -i option on does in fact allow me to use
> pgaccess without error.
>
> However, since I'm running pgaccess from a terminal window on my machine I
> would have thought that this would constitute a local domain socket
> connection (or at least a connection from the localhost), so I'm confused
> by the error message -- am I missing something or do I really have to
> enable TCP/IP connections if I want to initiate database access using
> pgacess from a terminal window?

Try not specifying a hostname or port in the login window.  Then it
should use the local unix socket method (I think).

--
Eric G. Miller <egm2@jps.net>