Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wwIkE-001tQK-2p for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Aug 2026 12:16:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wwIkC-00FVoz-2T for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Aug 2026 12:16:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wvwo0-00ABu5-1G for pgsql-bugs@lists.postgresql.org; Mon, 17 Aug 2026 12:51:09 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wvwny-00000001DPm-2ZDm for pgsql-bugs@lists.postgresql.org; Mon, 17 Aug 2026 12:51:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:Cc:From:To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:Sender:Content-ID: Content-Description:In-Reply-To:References; bh=6nJ88/ULYQDnmoQftZZyvrgjEeRidk3iK5usD4DO9Ho=; b=ahrBni9wkwTtR6kRklhCP5jD32 Cq9wMjSxqQe2KMCQ/JMySCCrjR/sRNCxeXAWrCakhNXkv7B4llkKFAQ6DzbCqjEgjwRxaUYPQ13MV lgxHQ0rqKhDEWp0OsM/IsTFHEfVOi/HMxrmlFsvQFMOL58WWMGqOLjT0pX7W14wnAOWnCEFwHienH /izgOTB4YEMzcY8JCQFkn2jfxu/mNsYhQUVjGJH/Z0/ZBuQpnlR9rXRb+omwiflmoQ+zcB0qiPirj o4TO/71aNXe1q94xpexg5jBiBBkg4hJabnEjauIHYMI3RdznitSOVwR/tx/JD2dUHWDz0lsk0T8rR ylFUGh0w==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wvwnx-003FGE-23 for pgsql-bugs@lists.postgresql.org; Mon, 17 Aug 2026 12:51:05 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1wvwnv-00000008jNB-49ql for pgsql-bugs@lists.postgresql.org; Mon, 17 Aug 2026 12:51:03 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #19624: postgresql14-devel (and in general postgresqlXX-devel) do not set PKG_CONFIG_PATH To: pgsql-bugs@lists.postgresql.org From: PG Bug reporting form Cc: michael.mayer@posit.co Reply-To: michael.mayer@posit.co, pgsql-bugs@lists.postgresql.org Date: Mon, 17 Aug 2026 12:50:59 +0000 Message-ID: <19624-9d8e09d2134408ae@postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The following bug has been logged on the website: Bug reference: 19624 Logged by: Michael Mayer Email address: michael.mayer@posit.co PostgreSQL version: 14.24 Operating system: Red Hat Enterprise Linux (any) Description: =20 I love your common repository where you offer more up-to-date versions of `gdal`, `proj` and `geos` for RHEL based linux distros. This enables many users to leverage those libraries when installing R packages that depend on versions of the mentioned packages that are newer compared to what Red Hat ships. When using the repository, any installation of `libpq-devel` will automatically install `postgresql14-devel`. This is fine in general and from a runtime linking perspective `postgresql14-libs` works as expected. When building an R package such as `RPostgresql` from source however, it fails to find both the include files and libraries to link to. This is caused by a non-existing `PKG_CONFIG_PATH` setting. It would be great if we could add a `%post` script to the `postgresql14-devel` RPM that would append the location of the pkgconfig files (e.g. `/usr/pgsql-14/lib/pkgconfig/`) to `PKG_CONFIG_PATH`. This will ensure that the include files and libs are found at configure and compile time as well. Example when installing `RPostgres` R package in RockyLinux 10 from sources [root@a11d116ef183 /]# /opt/R/4.6.0/bin/R -q -e 'pak::pak(c("RPostgres"))' > pak::pak(c("RPostgres")) =E2=9C=94 Updated metadata database: 2.87 MB in 8 files. =E2=9C=94 Updating metadata database ... done =20 =E2=86=92 Package library at /opt/R/4.6.0/lib/R/library. =E2=86=92 Will install 1 package. =E2=86=92 Will download 1 CRAN package (1.47 MB). + RPostgres 1.4.10 [bld][cmp][dl] (1.47 MB) + =E2=9C=96 libpq-devel =E2=86=92 Will install 1 system package: + libpq-devel - RPostgres =E2=84=B9 Getting 1 pkg (1.47 MB) =E2=9C=94 Got RPostgres 1.4.10 (source) (1.46 MB) =E2=84=B9 Installing system requirements =E2=84=B9 Executing `sh -c dnf install -y libpq-devel` =E2=84=B9 Building RPostgres 1.4.10 ^[[A=E2=9C=96 Failed to build RPostgres 1.4.10 (5.8s) Error: ! error in pak subprocess Caused by error in `stop_task_build(state, worker)`: ! Failed to build source package RPostgres. Full installation output: * installing *source* package =E2=80=98RPostgres=E2=80=99 ... ** this is package =E2=80=98RPostgres=E2=80=99 version =E2=80=981.4.10=E2= =80=99 ** package =E2=80=98RPostgres=E2=80=99 successfully unpacked and MD5 sums c= hecked staged installation is only possible with locking ** using non-staged installation Using PKG_CFLAGS=3D Using PKG_LIBS=3D-lpq ------------------------- ANTICONF ERROR --------------------------- Configuration failed because libpq was not found. Try installing: * deb: libpq-dev libssl-dev (Debian, Ubuntu, etc) * rpm: postgresql-devel (Fedora, EPEL) * rpm: postgreql8-devel, postgresql92-devel, postgresql93-devel, or postgresql94-devel (Amazon Linux) * csw: postgresql_dev (Solaris) * brew: libpq (OSX) If libpq is already installed, check that either: (i) 'pkg-config' is in your PATH AND PKG_CONFIG_PATH contains a libpq.pc file; or (ii) 'pg_config' is in your PATH. If neither can detect , you can set INCLUDE_DIR and LIB_DIR manually via: R CMD INSTALL --configure-vars=3D'INCLUDE_DIR=3D... LIB_DIR=3D...' --------------------------[ ERROR MESSAGE ]---------------------------- :1:10: fatal error: libpq-fe.h: No such file or directory compilation terminated. ----------------------------------------------------------------------- ERROR: configuration failed for package =E2=80=98RPostgres=E2=80=99 * removing =E2=80=98/tmp/Rtmp86r4DO/pkg-lib72f74d2a627/RPostgres=E2=80=99 --- Backtrace: 1. pak::pak(c("RPostgres")) 2. pak::pkg_install(pkg, ...) 3. pak:::remote(function(...) get("pkg_install_do_plan", asNamespace("pak"))(...), =E2=80=A6 4. err$throw(res$error) --- Subprocess backtrace: 1. base::withCallingHandlers(cli_message =3D function(msg) { =E2=80=A6 2. get("pkg_install_do_plan", asNamespace("pak"))(...) 3. proposal$install() 4. pkgdepends::install_package_plan(plan, lib =3D private$library, num_workers =3D nw, =E2=80=A6 5. base::withCallingHandlers({ =E2=80=A6 6. pkgdepends:::handle_events(state, events) 7. pkgdepends:::handle_event(state, i) 8. pkgdepends:::stop_task(state, worker) 9. pkgdepends:::stop_task_build(state, worker) 10. base::throw(pkg_error("Failed to build source package {.pkg {pkg}}.", = =E2=80=A6 11. | base::signalCondition(cond) 12. global (function (e) =E2=80=A6 Execution halted [root@a11d116ef183 /]# export PKG_CONFIG_PATH=3D/usr/pgsql-14/lib/pkgconfig:$PKG_CONFIG_PATH [root@a11d116ef183 /]# /opt/R/4.6.0/bin/R -q -e 'pak::pak(c("RPostgres"))' > pak::pak(c("RPostgres")) =E2=9C=94 Loading metadata database ... done =20 =E2=86=92 Package library at /opt/R/4.6.0/lib/R/library. =E2=86=92 Will install 1 package. =E2=86=92 Will download 1 CRAN package (1.47 MB). + RPostgres 1.4.10 [bld][cmp][dl] (1.47 MB) + =E2=9C=96 libpq-devel =E2=86=92 Will install 1 system package: + libpq-devel - RPostgres =E2=84=B9 Getting 1 pkg (1.47 MB) =E2=9C=94 Cached copy of RPostgres 1.4.10 (source) is the latest build =E2=84=B9 Installing system requirements =E2=84=B9 Executing `sh -c dnf install -y libpq-devel` =E2=84=B9 Building RPostgres 1.4.10 =E2=9C=94 Built RPostgres 1.4.10 (38.7s) =E2=9C=94 Installed RPostgres 1.4.10 (1.1s) =E2=9C=94 1 pkg + 16 deps: kept 16, added 1 [44.7s] > [root@a11d116ef183 /]#