showing locks from all postgres relations I'm trying to show all locks (DBMS-wide) in Postgres.

I initially tried adapting the documented example to:

SELECT pg_database.datname AS database, relation::regclass, pg_locks.database AS db_oid, pg_locks.relation AS rel_oid,
        locktype, page, tuple, virtualxid, transactionid, classid, objid, objsubid, virtualtransaction, pid, mode, granted
    FROM pg_locks
    LEFT OUTER JOIN pg_database ON (pg_locks.database = pg_database.oid)
    ORDER BY database, relation;


but Postgres seems to only be able to resolve the names of relations in the current catalog:

    database    |                relation                 | db_oid  | rel_oid |   locktype    | page | tuple | virtualxid  | transactionid | classid | objid | objsubid | virtualtransaction |  pid  |           mode           | granted
----------------+-----------------------------------------+---------+---------+---------------+------+-------+-------------+---------------+---------+-------+----------+--------------------+-------+--------------------------+---------
 franknfurter   | pg_locks                                | 2881378 |   11000 | relation      |      |       |             |               |         |       |          | 40/1709521         |  9684 | AccessShareLock          | t
 janet          |                                         | 3820378 | 3820698 | relation      |      |       |             |               |         |       |          | 97/3461972         | 19937 | AccessShareLock          | t
 janet          |                                         | 3820378 | 3820698 | relation      |      |       |             |               |         |       |          | 97/3461972         | 19937 | RowExclusiveLock         | t
                | pg_database_datname_index               |       0 |    2671 | relation      |      |       |             |               |         |       |          | 40/1709521         |  9684 | AccessShareLock          | t
 brad           |                                         |  772666 |  772946 | relation      |      |       |             |               |         |       |          | 28/1711346         |  9317 | ShareUpdateExclusiveLock | t
 franknfurter   | idx_posts_user_id_deleted_at            | 2881378 | 2883250 | relation      |      |       |             |               |         |       |          | 21/2032902         |  9602 | RowExclusiveLock         | t
 franknfurter   | pg_class                                | 2881378 |    1259 | relation      |      |       |             |               |         |       |          | 40/1709521         |  9684 | AccessShareLock          | t
 franknfurter   | posts_pkey                              | 2881378 | 2881707 | relation      |      |       |             |               |         |       |          | 21/2032902         |  9602 | RowExclusiveLock         | t
                |                                         |         |         | virtualxid    |      |       | 97/3461972  |               |         |       |          | 97/3461972         | 19937 | ExclusiveLock            | t


is this just a limitation of postgres or am I doing something differently?
You can only resolve names from the current database. This is because the pg_class table, which is what the ::reglass operator uses to resolve the names, is local to each database.