cannot connect to postgres 10

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

cannot connect to postgres 10

Post by albourgz » Thu 24 Aug 2017 12:10

Hi,

I installed a postgres 10.0 beta3 locally on my windows machine. Created one database "dbtest".
Using pgadmin 4, I can connect, create tables, indexes, ...
Using TUniConnection I can't connect, even at design time. Component tells (in french) Password authentication failed for user "postgres".
Tried 127.0.0.1 and localhost, port 5432, user postgres and postgres password specified at install (this password works with pgadmin). It doesn't work with TUniConnection. telnet 127.0.0.1 5432 works.
pg_hba.conf holds:
# IPv4 local connections:
host all all 127.0.0.1/32 md5

Any hint?

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: cannot connect to postgres 10

Post by ertank » Thu 24 Aug 2017 16:02

Hello,

I do not have a ready PostgreSQL 10 server to test. Would you please try changing below in your pg_hba.conf, restart the server and try to connect using TUniConnection.

Code: Select all

host    all             all             127.0.0.1/32            trust
If it works, please report here. Similar problem was solved several days after initial release of UniDAC 7.0.2 and download link updated keeping version number same after the fix implemented.

Maybe problem is somewhat related with PostgreSQL 10 adding a SCRAM authentication method. However, that needs to be activated in your pg_hba.conf and as to information you provide this is not the case.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: cannot connect to postgres 10

Post by azyk » Fri 25 Aug 2017 08:50

At the official developers' website, only PostgreSQL 10 Beta is available for download. Therefore, we haven't tested this version for compatibility with our DAC products. After the final version of PostgreSQL 10 is released, we will support it officially in PgDAC and UniDAC.

albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

Re: cannot connect to postgres 10

Post by albourgz » Fri 25 Aug 2017 09:00

Concerning trust, it is annoying for 2 reasons:
* if trust AND md5 are both enabled in pg_hba.conf, it doesn't work, connection is refused.
* trust means "no password check - always allow connection", it allows anybody to connect wthout knowing the password.

Let's hope this will be fixed when pg 10 will be supported (soon I hope, current release is beta 3).

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: cannot connect to postgres 10

Post by ertank » Fri 25 Aug 2017 09:47

If memory serves PostgreSQL 10 is to be released in November. We still have months, literally.

albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

Re: cannot connect to postgres 10

Post by albourgz » Fri 25 Aug 2017 10:09

Sorry guys,

the problem is the same agains official postgres 9.6.4.
md5 (password) authentication doesn't work.

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: cannot connect to postgres 10

Post by ertank » Fri 25 Aug 2017 11:52

Are you sure that you are using latest 7.0.2?

Please see my first reply. Devart released 7.0.2 and several days later they released new binaries with same version number.

Edit: I cannot recreate the problem. All is good and working in my tests. UniDAC 7.0.2, PostgreSQL 9.6.4. pg_hba.conf having following lines:

Code: Select all

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             0.0.0.0/0               md5
hostssl	all				all				0.0.0.0/0				md5 clientcert=1

albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

Re: cannot connect to postgres 10

Post by albourgz » Fri 25 Aug 2017 12:08

yes sure. But I am using the default postgres user to connect. I didn't create other user using "create user ...".

ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

Re: cannot connect to postgres 10

Post by ertank » Fri 25 Aug 2017 12:58

I just tested with default user postgres. No problems.

However, I am using Delphi Tokyo and you seem to be using CBuilder Seattle. Problem maybe in your version of the release.

albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

Re: cannot connect to postgres 10

Post by albourgz » Tue 29 Aug 2017 13:41

What seems strange (9.6) is that if both trust and md5 are allowed in pg_hba.conf, connection is refused from component even if trust is set.
If only trust is allowed in pg_hba.conf, connection is allowed from component.

Post Reply