I have created a shared hash table in partitioned mode inside the postgres server code. In order to guard the partitions, I'm trying to initialize an array of LWLocks. The code that I'm trying to use for that is
which implies that IsUnderPostmaster must be false and lock_named_request_allowed should be true. Thus, I had invoked RequestNamedLWLockTranche before the first call to LWLockShmemSize which sets lock_named_request_allowed = true and GetNamedLWLockTranche later. This works in the single user mode but fails when I start the server explicitly through postgres -D ...