Probably the easiest way is to open a connection for the current database,
call it "currentconn", and do:
However, note that this isn't an "officially supported" technique: in
particular, it will give the wrong results if the configuration of the
current database is not identical to the main database.