Re: Please Help me with connecting my PostgreSQL

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: psycopg(at)postgresql(dot)org, Lasntonpeng <lanstonpeng(at)gmail(dot)com>, psycopg-owner(at)postgresql(dot)org
Subject: Re: Please Help me with connecting my PostgreSQL
Date: 2011-03-31 14:07:57
Message-ID: 201103310707.58583.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Thursday, March 31, 2011 6:42:35 am Daniele Varrazzo wrote:

>
> To connect to a database on the local machine, the quick answer is:
> add host=127.0.0.1 to the connection string, which makes it connect to
> the network socket instead of the unix socket. And I mean "127.0.0.1",
> not "localhost".

localhost works also:)

No host specified:
[unknown]-2011-03-31 07:00:26.140 PDT-0LOG: connection received: host=[local]
aklaver-2011-03-31 07:00:26.142 PDT-0LOG: connection authorized: user=aklaver
database=test

localhost specified:
[unknown]-2011-03-31 07:00:52.809 PDT-0LOG: connection received: host=127.0.0.1
port=51196
aklaver-2011-03-31 07:00:52.864 PDT-0LOG: connection authorized: user=aklaver
database=test

127.0.0.1 specified:
[unknown]-2011-03-31 07:01:29.853 PDT-0LOG: connection received: host=127.0.0.1
port=51197
aklaver-2011-03-31 07:01:29.922 PDT-0LOG: connection authorized: user=aklaver
database=test

>
> All the gory details are in the pg_hba.conf documentation.
>
> -- Daniele

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message David Blewett 2011-03-31 14:12:22 Re: Please Help me with connecting my PostgreSQL
Previous Message Daniele Varrazzo 2011-03-31 13:42:35 Re: Please Help me with connecting my PostgreSQL