SELECT
    locktype,
    relation::regclass,
    mode,
    transactionid AS tid,
    virtualtransaction AS vtid,
    pid,
    granted
FROM
    pg_catalog.pg_locks l
    LEFT JOIN pg_catalog.pg_database db ON db.oid = l.database
WHERE (db.datname = 'dawndb'
    OR db.datname IS NULL)
AND NOT pid = pg_backend_pid();
