Adding one CheckTableNotInUse() for REINDEX CONCURRENTLY
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:t41848psql -h localhost -U postgresBuilt from patchset v1 (message #1), July 28, 2026 at 03:12 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 t41848_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 t41848_1 && git checkout t41848_1Patchset v1 (message #1) is on t41848_1
Hi all,
As mentioned on the thread dealing with concurrent indexing for
temporary relations, it sounds like a good thing to make the code more
defensive if attempting to do a REINDEX CONCURRENTLY with a backend
still holding references to the indexes worked on:
/messages/by-id/20191212213709.neopqccvdo724eha@alap3.anarazel.de
One thing is that as REINDEX CONCURRENTLY cannot be used in
transaction blocks, this cannot be triggered in the context of a
function call, say with this patch:
+ERROR: REINDEX CONCURRENTLY cannot be executed from a function
+CONTEXT: SQL statement "REINDEX INDEX CONCURRENTLY reindex_ind_ref"
+PL/pgSQL function reindex_func_ref() line 3 at EXECUTE
Attached is a patch to do that. I am not sure if the test added in
the patch has much additional value, but feel free to look at it. Any
thoughts?
--
Michael