Kresimir Tonkovic <z-el(dot)tonkovic(at)chipoteka(dot)hr> writes:
> I have a situation regarding locks that nobody seems to own:
The only way pid can be null in a pg_locks entry is if the lock is held
by a prepared transaction. See pg_prepared_xacts view.
regards, tom lane