Now I wonder if it is possible, given the id of one of the locked rows in the queue table, to find out which connection/which transaction owns the lock
I'd start here:
and the pg_stat_activity view:
The system doesn't really understand your model ID/PK field - the system views and catalogs using system identifiers.
David J.