pgsql: Fix assertion in pg_get_shmem_pagesize() in single-user mode

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix assertion in pg_get_shmem_pagesize() in single-user mode
Date: 2026-09-24 11:50:12
Message-ID: E1x9hxs-000000013br-3sHc@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix assertion in pg_get_shmem_pagesize() in single-user mode

Remove assertion that was too strict, and tripped if you queried the
pg_shmem_allocations_numa or the pg_buffercache_os_pages view in
single-user mode.

The point of the assertion was that the function should only be called
after "the server has started", but it would be OK to call it from the
postmaster, too, as long as it's after startup, specifically after
huge_pages_status has been set. We already have a direct assertion
for that.

Author: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/CAJTYsWV-=w5_oFgCnfAixWGc=gMa2pkDinLyGLsb4sKcDaf2FA@mail.gmail.com
Backpatch-through: 18

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dae3463fa969931458f1488f9b7af11e3741cd54

Modified Files
--------------
src/backend/storage/ipc/shmem.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-09-24 15:22:11 pgsql: Fix ShmemInitStruct() reattachment in single-user mode
Previous Message Amit Langote 2026-09-24 10:33:00 pgsql: Ensure ExecutorCheckPerms_hook is called from RI fast path