Re: dblink authentication failed

Поиск
Список
Период
Сортировка
От Attila Kiss
Тема Re: dblink authentication failed
Дата
Msg-id zarafa.577106db.2012.5a5edf89767b257a@vezuv.dardanis.hu
обсуждение исходный текст
Ответ на dblink authentication failed  ("Kiss Attila" <kiss.attila@dardanis.hu>)
Ответы Re: dblink authentication failed  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general

I've got some additional info about the problem.

After several times trying to connect to the remote database, I tried to connect to the local database with dblink. I edit the .pgpass file like this:

127.0.0.1:5432:*:postgres:password

192.168.1.40:5432:*:myusername:mypassword

 

Then I tried to connect from local sql server:

postgres=# select dblink_connect_u('con1','hostaddr=127.0.0.1 port=5432 dbname=postgres user=postgres');

I get the same error like before. But when I edit the .pgpass and change 127.0.0.1 to 'localhost', it works even if I try it with the exactly same connection string in dblink(hostaddr=127.0.0.1). I don't know what is going on in the background, maybe some IP address<->hostname problem?

 


 

-----eredeti Üzenet-----
Feladó: Kiss Attila <kiss.attila@dardanis.hu>
Elküldött: Hétfő 2016.06.27 09:42
Tárgy: [GENERAL] dblink authentication failed
Címzett: pgsql-general@postgresql.org;
body { font-family: monospace; }

Hello,

I have some problem with using dblink_connect_u() in my function.
When I provide the password in the connection string, there is no problem, but when I don’t, it says:
ERROR:  could not establish connection

DETAIL:  fe_sendauth: no password supplied

However the .pgpass file in the path /var/lib/postgres/.pgpass does contain the proper password.
I have tried to connect to the remote server with psql from bash with the following command:
# psql –h 192.168.1.40 –U myuser –w remote_db_name

it works fine.

My .pgpass file does have the line:
192.168.1.40:5432:*:myuser:mypassword

It seems the psql finds the proper password in the .pgpass file but dblink doesn’t.

The local and the remote server are running on Ubuntu server 14.04, both of them are PostgreSQL 9.4.

The .pgpass file properties look this:

# ls –la ./.pgpass
-rw------- 1 postgres postgres 193 jún   24 13:54 ./.pgpass


Any ideas are welcome.

Regards,

Attila


Mentes a vírusoktól. www.avast.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Attila Kiss
Дата:
Сообщение: Re: dblink authentication failed
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Updated RUM?