WARNING: missing lock on database "postgres" (OID 5) @ TID (0,4)

Alexander Kukushkin <cyberdemn@gmail.com>

From: Alexander Kukushkin <cyberdemn@gmail.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>, noah@leadboat.com
Date: 2024-12-09T10:27:06Z
Lists: pgsql-hackers
Hello Hacker,

When Postgres is compiled with --enable-cassert I get subj when doing the
following:
postgres=# create user test;
CREATE ROLE
postgres=# alter database postgres owner to test;
ALTER DATABASE
postgres=# reassign owned by test to postgres;
WARNING:  missing lock on database "postgres" (OID 5) @ TID (0,4)
REASSIGN OWNED

It was discovered on 16.6, however the master shows the same behaviour.
I suspect it to be due to aac2c9b4fde889d13f859c233c2523345e72d32b.

Regards,
--
Alexander Kukushkin

Commits

  1. In REASSIGN OWNED of a database, lock the tuple as mandated.

  2. For inplace update durability, make heap_update() callers wait.