Removal of ResourceOwnerReleaseAllOfKind function
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t253736psql -h localhost -U postgresBuilt from patchset v1 (message #1), September 20, 2026 at 09:57 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t253736_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t253736_1 && git checkout t253736_1Patchset v1 (message #1) is on t253736_1
Hi,
There appears to be a consensus in thread [1]/messages/by-id/646741.1782157515@sss.pgh.pa.us regarding the removal of
the ResourceOwnerReleaseAllOfKind function. It contains errors and is
rarely used, except in a few instances within the plpgsql code.
Furthermore, in those cases, it releases all resources held by the
resource owner instead of releasing resources of a specific kind. It
mainly exists to bypass the three-phase resource release mechanism.
So here is an attempt to add better-designed code to allow releasing
all resources of
a resource owner without using the three phase release mechanism when
it is not needed.
Attached patch adds a new ResourceReleasePhase value,
RESOURCE_RELEASE_AT_ONCE. A ResourceOwnerRelease(owner,
RESOURCE_RELEASE_AT_ONCE, ...) call sorts the owner's resources as
usual, then releases every remaining entry regardless of its
individual release_phase, without breaking out between phases. Leak
warnings are unconditionally suppressed for this phase, since anything
found is by definition meant to be released here, not left behind by
mistake. ResourceOwnerReleaseAllOfKind() is removed, and the plpgsql
call sites each make one ResourceOwnerRelease() call instead of three
phased ones.
A secondary cleanup results from this: `releasing` and `sorted` were
two separate booleans in `ResourceOwnerData` only because
`ResourceOwnerReleaseAllOfKind()` needed to set `releasing` without
sorting. With that function gone, the two flags are always set
together, so they collapse into one flag(releasing).
This approach maintains a single release path via ResourceOwnerRelease
function call and avoids maintaining two separate functions that
perform nearly the same task.
Kindly let me know your views.
[1]: /messages/by-id/646741.1782157515@sss.pgh.pa.us
Best Regards,
Rahila Syed