On Thu, Oct 24, 2024 at 10:24:29PM -0400, Wietse Venema via Postfix-users wrote:

> I suppose that the PostgreSQL client library code is looking up the
> username, and using that as the default database name for a connection
> URI.

Yes, something like that.

> Viktor, I don't think that Postfix's pgsql client cares what URI
> scheme is being used, as long as the PostgreSQL client library finds
> it acceptable. So we can simplify the text to:

Sadly, I believe the Postfix pgsql driver reaches in and does some
minimal parsing of each host to determine whether it is a URI or not:

    
https://github.com/vdukhovni/postfix/blob/a5b1b93841f14c32ddc9772887a664e7736b3826/postfix/src/global/dict_pgsql.c#L763-L785

> PGSQL PARAMETERS
>        hosts  The hosts that Postfix will try to connect to and
>              query from. Besides a PostgreSQL connection URI,
>              this setting supports the historical forms unix:/pathname
>              for UNIX-domain sockets and [...]

So we only support "postgresql:" and "postgres:", because with non-URL
hosts, we use a legacy API to separately specify host, port, database,
username and password:

    
https://github.com/vdukhovni/postfix/blob/a5b1b93841f14c32ddc9772887a664e7736b3826/postfix/src/global/dict_pgsql.c#L567-L573

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to