kgeis@speakeasy.net writes:
> The second section has an unnecessarily complex query that caused me
> problems because pg_database contains a column of type aclitem[] which
> does not support binary transfer from the database.
Say what?
The proposed change is probably a good idea anyway, primarily because
there isn't necessarily any template1 database. But if fetching
aclitem[] fails then there's something quite wrong, and I don't believe
it's on the server side.
regards, tom lane