Basically I would rename template1 to pg_master and connect postmaster
to this database. Then it would have access to system global sql info.
The problem is: postgres backends would need to do a reconnect to their
own database instead of a connect.
Andreas