Control: tags -1 + confirmed

On Tue, Sep 23, 2025 at 10:56:08AM +0200, Pieter Lexis wrote:
> This morning, my Sid system upgraded dovecot-pgsql from 1:2.4.1+dfsg1-6
> to 1:2.4.1+dfsg1-7. During the same upgrade, libpq5 was updated from 17.6 to 
> 18~rc2.
> 
> After this, dovecot is unable to connect to the database, spewing errors
> like:
> 
> Sep 23 10:38:58 mango dovecot[4295]: auth: Error: Couldn't load plugin 
> /usr/lib/dovecot/modules/auth/libdriver_pgsql.so: dlopen() failed: 
> /usr/lib/dovecot/modules/auth/libdriver_pgsql.so: undefined symbol: 
> PQsendQuery
> Sep 23 10:38:58 mango dovecot[4295]: auth: Fatal: passdb sql: Unknown 
> database driver 'pgsql'
> 
> Looking at ldd for ldd /usr/lib/dovecot/modules/libdriver_pgsql.so, I
> see that it is not linked against libpq5.so.
> 
> I tried reinstalling either package, but this did not fix the issue.
> 
> The same file on Debian Trixie is linked against libpq5.so. There might
> have been a change between the dovecot in Trixie and Sid, or the Sid
> package might need to be rebuilt and linked against the new libpq5?
> 
> I don't seem to have a copy of the old package file around, so I am
> converting my installation to not use Postgresql to ensure I can receive
> email.

Other than changing some config file defaults (none related to pgsql
support) there's only one code change in 1:2.4.1+dfsg1-7.  It does
change auth behavior, but only related to passdb lookup caching and not
related to pgsql support.

I notice the following from the build logs:

>From -6:
checking for libpq... yes
checking for PQescapeStringConn in -lpq... yes
...
libtool: link: gcc -shared  -fPIC -DPIC  
.libs/libdriver_pgsql_la-driver-pgsql.o   -lpq  -g -O2 
-Werror=implicit-function-declaration 
-ffile-prefix-map=/build/reproducible-path/dovecot-2.4.1+dfsg1=. -flto=auto 
-fstack-protector-strong -Werror=format-security -fstack-protector-strong 
-mfunction-return=keep -mindirect-branch=keep -flto=auto -Wl,-z -Wl,relro 
-Wl,-z -Wl,now   -Wl,-soname -Wl,libdriver_pgsql.so -o .libs/libdriver_pgsql.so

>From -7:
checking for libpq... no
checking for libpq library in expected file paths... using PGSQL_CFLAGS="" and 
PGSQL_LIBS=""
checking for PQconnectdb in -lpq... yes
checking for PQescapeStringConn in -lpq... yes


It's interesting that the configure script in -7 claims to find some key
symbols in -lpq, but also claims that it couldn't find libpq itself.  In
any case, we never see the subsequent linker invocation.

Since nothing in dovecot changed in this area, it seems likely that this
was caused by the update to postgres 18 in sid.  I need to investigate
what's going on in the configure script that prevents it from finding
-lpq; it may be an issue in the script or with libpq-dev.

noah

Reply via email to