Re: network problems: -h flag not working properly

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Neil Zanella <nzanella(at)cs(dot)mun(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: network problems: -h flag not working properly
Date: 2003-05-25 02:50:21
Message-ID: 20030525025021.GC17757@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, May 23, 2003 at 05:25:12AM -0700, Neil Zanella wrote:
> Hello,
>
> I am running Red Hat 9 with PostgreSQL 7.3.2 and have the following entry at the
> top of /etc/hosts and can shell into my computer from a remote location without
> any hassle:
>
> 127.0.0.1 localhost.localdomain localhost
>
> I can also run "psql foobar" to connect to database "foobar" from my copmputer.
> However, when I issue the following commands from my computer:
>
> $ psql foobar
> foobar=# \q
> $ psql -h 127.0.0.1 foobar
> psql: could not connect to server: Connection refused
> Is the server running on host 127.0.0.1 and accepting
> TCP/IP connections on port 5432?

When you don't specify a host, it connects via a unix domain socket, which
works. If you specify a host it uses TCP/IP which evidently doesn't. Go to
your server config and find the 'tcpip_socket' and set it to true.

By the way, did you read the error message?

> Also, what is the difference between "CREATE DATABASE" and "CREATE SCHEMA"?

A table is in a schema. There can be multiple schemas in a database. There
can be multiple databases per database cluster. A single postmaster looks
after a single database cluster.

Hope this helps,

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
> - Samuel P. Huntington

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-05-25 03:11:51 Re: Migrating LATIN1 dump to UNICODE db
Previous Message Larry Rosenman 2003-05-25 02:31:48 Re: Iterating through individual fields of OLD/NEW