Thread: Help with PostgreSQL Access

Help with PostgreSQL Access

From
Andrew Tuson
Date:
Apologies if this is an FAQ, but I haven't been able to find an answer
anywhere.

I have created a database using psql, created a couple of tables and populated
them, following the tutorial on the PostrgreSQL site.  I can view the
contents of the tables using SELECT so the database exists and contains data.

My query is concerning PostgreSQL Access.  When I open it none of the icons
work and I assume that I have to use Database/Open to tell it the name of my
database.  The Host is shown as localhost and the Port is set to 5432.  No
matter what I enter in the other icons I get the following error message:

Connection to database failed
could not connect to server: Connection refused
Is the server running on host localhost and
accepting TCP/IP connections on port 5432?

I have tried this on 2 machines running PostgreSQL 7.2.2-1 on Mandrake Linux
9.0.

Any suggestion would be gratefully received.

Andrew Tuson

Re: Help with PostgreSQL Access

From
"Josh Berkus"
Date:
Andrew,

> Connection to database failed
> could not connect to server: Connection refused
> Is the server running on host localhost and
> accepting TCP/IP connections on port 5432?

Was postmaster started with the "-i" option, allowing postgres to
accept connections via TCP/IP?   This is the usual cause for that
particular error message.

PSQL will work via UDP, but not PGAccess or PHPPgAdmin.  A quick test
would be to try to connect to your database from another machine using
PSQL; if you get the exact same message, you don't have "-i" set.

-Josh Berkus

Re: Help with PostgreSQL Access

From
Oliver Elphick
Date:
On Sun, 2002-11-17 at 20:25, Andrew Tuson wrote:
...
> My query is concerning PostgreSQL Access.  When I open it none of the icons
> work and I assume that I have to use Database/Open to tell it the name of my
> database.  The Host is shown as localhost and the Port is set to 5432.  No
> matter what I enter in the other icons I get the following error message:
>
> Connection to database failed
> could not connect to server: Connection refused
> Is the server running on host localhost and
> accepting TCP/IP connections on port 5432?

Presumably you did not start the postmaster with -i, or else your
settings in $PGDATA/pg_hba.conf do not allow TCP/IP access from
localhost.

The easiest solution is to remove "localhost" from the Host field and
leave that blank.  The connection should then use the Unix socket rather
than TCP/IP.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "A Song for the sabbath day. It is a good thing to
      give thanks unto the LORD, and to sing praises unto
      thy name, O most High."   Psalms 92:1


Re: Help with PostgreSQL Access

From
Vijay Deval
Date:
Dear Andrew

Have you started postmaster with -i option?

Vijay

Andrew Tuson wrote:

> Connection to database failed
> could not connect to server: Connection refused
> Is the server running on host localhost and
> accepting TCP/IP connections on port 5432?