Using the SRF scheme discussed on -hackers yesterday. The only changes to the patch since it was posted on -hackers are cosmetic: I adapted the patch to apply cleanly against the latest CVS code, and changed the name of the return view to pg_show_locks_result.
When/if the patch is applied, I'll send in another patch adding some documentation, and perhaps some higher-level views that use the SRF and the system catalogs to return some useful information.
This requires an initdb. Unless anyone sees a problem, please apply.
-- Neil Conway <neilconway(at)rogers(dot)com> PGP Key ID: DB3C29FC