On 23/11/2025 18:33, Smith via Postfix-users wrote:
On Sunday, 23 November 2025 at 14:10, John Fawcett via Postfix-users
<[email protected]> wrote:
Hi
my suggestion would be to look at the hosts setting.
You stated above that the hosts setting started with something like this:
hosts=postgresql://
But if you compare that to the error message it is not quite the same thing:
connect to pgsql server postgres://
The postgresql C library has two different functions for connecting to the
database, one based on the url type syntax and one based on explicit
parameters. When deciding which function to call, Postfix checks whether the
hosts parameter starts with postgresql. In your original configuration I guess
this was the case, but from the error message, I doubt whether that is still
the case.
If you go back to the postgresql:// syntax hopefully you will solve the problem.
Interesting spot John !
According to the docs
(https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS)
"The URI scheme designator can be either postgresql:// or postgres://."
But changing Postfix to "postgresql://" did change the nature of my error
message.
I now get "failed: Connection timed out??Is the server running on that host and
accepting TCP/IP connections??"
Which also doesn't make sense. Because it is running, I can connect to it via
psql, using the same url, it logs in instantly.
Only thing I can think of its its a v4 only postgres host whilst the posfix
server is dual-stack. But surely Postfix would fallback promptly to v4 ?
Hi
I would make sure that the hostname that you are specifying in the URL
resolves only to an ipv4 address if the postgresql server is only
listening on ipv4.
John
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]