Re: Facing authentication error on postgres 9.2 -> dblink functions

From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Facing authentication error on postgres 9.2 -> dblink functions
Date: 2013-02-06 20:18:01
Message-ID: CALSLE1MJn-Vuv3uM5SZSuBwfmre=ZY9VC=dav9i_kbTnO910pA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers pgsql-sql

Checked further netstat and could see following lines:
TCP 0.0.0.0:5432 0.0.0.0:0 LISTENING

Then checked from remote machine 'telnet' to target database machine and
could see connection failing, looking further port was blocked and
unblocking port resolved this. Queries working fine.

So far so good..

Thanks...

On Thu, Feb 7, 2013 at 12:49 AM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com> wrote:

> Hey went ahead and tried to query across machines and facing following
> error:
>
> SELECT * FROM dblink_connect('host=x.x.x.x port=5432 dbname=postgres
> user=postgres password=test')
>
> could not connect to server: Connection timed out (0x0000274C/10060)
> Is the server running on host "x.y.z.com" (x.x.x.x) and accepting
> TCP/IP connections on port 5432?
>
> Tried modifying pg_hba as follows:
> 1st try
> host all all 0.0.0.0/0 md5
>
> 2nd try
> host all all .z.com md5
>
>
> postgresql.conf looks good for connections and authentication:
> listen_addresses = '*'
>
> Please suggest?
>
> Thanks...
>
> On Wed, Feb 6, 2013 at 11:25 PM, Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>wrote:
>
>> Great.. thanks a lot Laurenz Albe!
>>
>> Works perfect !!
>>
>> Regards - Dev
>>
>>
>> On Wed, Feb 6, 2013 at 7:00 PM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>wrote:
>>
>>> Dev Kumkar wrote:
>>> > I am using postgres 9.2 and when executing function dblink facing a
>>> fatal error while trying to
>>> > execute dblink_connect as follows:
>>> >
>>> > SELECT * FROM dblink_connect('host=127.0.0.1 port=5432
>>> dbname=postgres password=test')
>>> >
>>> > ERROR: could not establish connection DETAIL: FATAL: password
>>> authentication failed for user
>>> > "NETWORK SERVICE"
>>> >
>>> > What this error is related to? Do I need to modify pg_hba.conf file by
>>> any chance?
>>>
>>> You should specify a user=username option in the connection string,
>>> otherwise that defaults to your operating system user name.
>>>
>>> Yours,
>>> Laurenz Albe
>>>
>>
>>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mel Llaguno 2013-02-07 00:58:50 PostgreSQL's share_buffer calculation using shmget() versus kernel.shmmax
Previous Message Dev Kumkar 2013-02-06 19:19:21 Re: Facing authentication error on postgres 9.2 -> dblink functions

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-02-06 20:24:21 Re: [COMMITTERS] pgsql: Fast promote mode skips checkpoint at end of recovery.
Previous Message Merlin Moncure 2013-02-06 19:42:54 Re: Alias hstore's ? to ~ so that it works with JDBC

Browse pgsql-sql by date

  From Date Subject
Next Message JORGE MALDONADO 2013-02-07 01:08:05 Conditional expression in an UPDATE statement
Previous Message JORGE MALDONADO 2013-02-06 20:04:05 Re: Setting a default value for a select statement without results