PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> The comment for the function LockRelationIdForSession mentions “It will be
> removed when UnlockRelationIdForSession() is called, or if an
> ereport(ERROR) occurs, or if the backend exits.”
> However, the callback function ShutdownPostgres, which is triggered during
> process exit, only cleans up locks of type USER_LOCKMETHOD. Is it possible
> to automatically clean up session locks of type DEFAULT_LOCKMETHOD?
I think you are looking in the wrong place. Normal locks are released
in the transaction-ending code. We need the special case in
ShutdownPostgres because that's not true for user locks.
regards, tom lane