Subject: Request to Add New Package: pgsentinel

From: Huang Yuying <[email-masked]>
Date: Mon, 21 Jul 2025 19:09:19 +0000

Dear PostgreSQL Package Debian Team,

My name is Laura Huang, and I am writing to request consideration for adding a new package for the existing PostgreSQL extension, pgsentinel, within the PostgreSQL community. This package was developed under the mentorship and guidance of Jeremy Schneider (cc’d), who has been involved throughout the process.

pgsentinel is used for sampling and recording active session history in PostgreSQL databases. It enables users to monitor session activities, linking it with query statistics from pg_stat_statements, and provides deeper visibility into workload patterns, blocking events, and query performance.

To facilitate easier installation and broader usability, we have created a package for pgsentinel that supports multiple PostgreSQL versions (14 and above). By offering pgsentinel as a package, users benefit from easier upgrades, simplified integration with system package managers, and improved maintainability compared to manual installation methods.

For the recently released PostgreSQL 18-beta, we have manually tested pgsentinel with PostgreSQL 18-beta and confirmed that it works as expected, collecting data and functioning properly.

The packaging code is publicly available at: https://salsa.debian.org/laurah159/pgsentinel/.

To support packaging, we made the following changes to the upstream pgsentinel code:

  1.  Added a top-Level Makefile
The upstream repo places its Makefile in the src/ directory. However, during debuild, the build process expects a Makefile at the root. To resolve this, we added a top-level Makefile in the root directory that points to src/Makefile.
(Alternatively, we considered adding the '--sourcedirectory=src' suffix to all overrides in the debian/rules file, but opted for the top-level Makefile approach. If there is a preferred or better method, please let us know.)

  1.  Updated Makefile for Testing
In the original Makefile, the line 'REGRESS_OPTS = --temp-config=./pgsentinel.conf --temp-instance=./tmp_check' causes a conflict, since debuild already creates a temporary cluster for regression checks during installcheck, specifying '--temp-instance=./tmp_check' leads to errors. We adjusted this to avoid the conflict.
Forked repo with changes: https://github.com/laurahuang106/pgsentinel

We plan to open a PR against the upstream pgsentinel repository tomorrow or Wednesday. If you have any guidance or suggestions, we would greatly appreciate your feedback!

By the way, in the debian/control.in file, is it possible to add two uploaders? Jeremy will probably be the ongoing maintainer, and I would like to include him as an uploader.

Thank you for your time and consideration. Looking forward to your response!

Best regards,
Laura

---

From: Christoph Berg <[email-masked]>
Date: Mon, 21 Jul 2025 22:06:33 +0200

Re: Huang Yuying
>   1.  Added a top-Level Makefile

Hi,

this doesn't to be present yet in the 1.1.0 tarball. How did you
invoke the build such that it actually worked?

$ dpkg-buildpackage -rfakeroot -us -uc -i -I -j20
dpkg-buildpackage: info: source package pgsentinel
dpkg-buildpackage: info: source version 1.1.0-1
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by Laura H. <[email-masked]>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source -i -I --before-build .
 debian/rules clean
dh clean --with pgxs_loop
   dh_auto_clean --buildsystem=pgxs_loop
	pg_buildext clean build-%v postgresql-%v-pgsentinel
rm -rf build-*/
rm -rf debian/postgresql-17-pgsentinel/ debian/postgresql-*-pgsentinel.substvars
   dh_clean
   pg_buildext checkcontrol
 dpkg-source -i -I -b .
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building pgsentinel using existing ./pgsentinel_1.1.0.orig.tar.gz
dpkg-source: info: building pgsentinel in pgsentinel_1.1.0-1.debian.tar.xz
dpkg-source: info: building pgsentinel in pgsentinel_1.1.0-1.dsc
 debian/rules binary
dh binary --with pgxs_loop
   dh_update_autotools_config
   dh_autoreconf
   dh_auto_build --buildsystem=pgxs_loop
   create-stamp debian/debhelper-build-stamp
   dh_prep
   dh_auto_install --buildsystem=pgxs_loop --destdir=debian/postgresql-17-pgsentinel/
	pg_buildext loop postgresql-%v-pgsentinel
### PostgreSQL 17 loop ###
# 17: make
make[1]: Entering directory '/home/myon/projects/postgresql/pgsentinel/pgsentinel'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory '/home/myon/projects/postgresql/pgsentinel/pgsentinel'
### End 17 loop (FAILED with exit code 2) ###
dh_auto_install: error: pg_buildext loop postgresql-%v-pgsentinel returned exit code 2
make: *** [debian/rules:10: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

> By the way, in the debian/control.in file, is it possible to add two uploaders? Jeremy will probably be the ongoing maintainer, and I would like to include him as an uploader.

It's a comma-separated list.

Christoph

---

From: Huang Yuying <[email-masked]>
Date: Mon, 21 Jul 2025 22:55:28 +0000

Hi Christoph,

Thank you for your prompt response!

Regarding the build issue you mentioned, for testing, we manually downloaded the code from my GitHub repository (forked repo: https://github.com/laurahuang106/pgsentinel) instead of letting Debian pull it using the watch file.

The Makefile is not yet in the upstream repository. As mentioned in the previous email, we made some changes to the source code, and pushed to my forked repo. Does anyone here think it might be better to add the '--sourcedirectory=src' suffix to all overrides in the debian/rules file instead of creating a top-level Makefile?

Please let me know if you have any questions or suggestions. Thank you!

Sincerely,
Laura

------------------------------------------------------------------------------------------------------------------------------

On 7/21/25, 13:06, "Christoph Berg" <[email-masked] <mailto:[email-masked]>> wrote:

Re: Huang Yuying
> The packaging code is publicly available at: https://salsa.debian.org/laurah159/pgsentinel/ <https://salsa.debian.org/laurah159/pgsentinel/>.
> 

Hi,

dpkg-buildpackage: info: source changed by Laura H. <[email-masked] <mailto:[email-masked]>>

Christoph

---

From: Jeremy Schneider <[email-masked]>
Date: Mon, 21 Jul 2025 23:49:59 -0700

On Mon, 21 Jul 2025 22:55:28 +0000
Huang Yuying <[email-masked]> wrote:

> Regarding the build issue you mentioned, for testing, we manually
> downloaded the code from my GitHub repository (forked repo:
> https://github.com/laurahuang106/pgsentinel) instead of letting
> Debian pull it using the watch file.

FYI - running through it just now, and Laura I think an editor turned
the tabs into spaces at some point while the files were on their way to
GitHub. Should be a quick & easy fix.

After I changed the spaces back to tabs, and updated the file
pgsentinel_1.1.0.orig.tar.gz one level up from my build directory, the
tests succeed and the packages build for me.

I think we can go ahead and send Bertrand a PR with the two Makefile
updates. I suspect the top-level Makefile is the best way to go here.

-Jeremy

-- 
To know the thoughts and deeds that have marked man's progress is to
feel the great heart throbs of humanity through the centuries; and if
one does not feel in these pulsations a heavenward striving, one must
indeed be deaf to the harmonies of life.

Helen Keller. Let Us Have Faith. Doubleday, Doran & Company, 1940.

---

From: Huang Yuying <[email-masked]>
Date: Wed, 30 Jul 2025 12:57:31 +0000

Hi everyone,

Just wanted to give you a quick update that a new version of pgsentinel has been released with the changes needed to support the Debian build process, as mentioned in the previous email. We’ve also updated the Salsa repo to reflect this new release.

Best regards,

Laura

________________________________
From: Jeremy Schneider <[email-masked]>
Sent: Tuesday, July 22, 2025 2:49:59 AM
To: Huang Yuying <[email-masked]>
Cc: Christoph Berg <[email-masked]>; [email-masked] <[email-masked]>; [email-masked] <[email-masked]>
Subject: Re: Request to Add New Package: pgsentinel

-Jeremy

---

From: Christoph Berg <[email-masked]>
Date: Wed, 30 Jul 2025 16:53:16 +0200

Re: Huang Yuying

Hi,

thanks for preparing that, everything looks just fine and I already
built and uploaded the packages.

The repo is now located at https://salsa.debian.org/postgresql/pgsentinel,
I gave you maintainer access to it.

First bugreport: PG18 doesn't work yet :)

16:45:03 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -Wmissing-variable-declarations -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -Werror=implicit-function-declaration -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fno-omit-frame-pointer -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -fPIC -fvisibility=hidden -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-implicit-fallthrough -Iinclude -I. -I./ -I/usr/include/postgresql/18/server -I/usr/include/postgresql/internal    -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o pgsentinel.o pgsentinel.c
16:45:03 pgsentinel.c:77:7: error: no previous declaration for ‘pgsentinelDbName’ [-Werror=missing-variable-declarations]
16:45:03    77 | char *pgsentinelDbName = "postgres";
16:45:03       |       ^~~~~~~~~~~~~~~~
16:45:03 cc1: all warnings being treated as errors

https://jengus.postgresql.org/job/pgsentinel-binaries-beta/1/architecture=amd64,distribution=sid/console

Christoph

---

From: Bertrand Drouvot <[email-masked]>
Date: Thu, 31 Jul 2025 05:04:05 +0000

Hi,

> > Just wanted to give you a quick update that a new version of pgsentinel has been released with the changes needed to support the Debian build process, as mentioned in the previous email. We’ve al…

Thanks for doing this!

> First bugreport: PG18 doesn't work yet :)

Thanks for the report! ;-)

> 16:45:03    77 | char *pgsentinelDbName = "postgres";

Just pushed a fix.

Best,
Bertrand