I don't have time to work on this now. Hopefully, someone will step forward who can help (please!).
you may be interested to know that I have spent the day making sure the new HotPotatoes module works with PostgreSQL. There were a couple of "gotchas" but in the end it is all working. The reports, the backup and restore, I can confirm it all worked.
The hardest part for me was installing PostgreSQL and phpPgAdmin, otherwise I would have posted this before the weekend!
Anyway, you can download the latest "PostgreSQL-compatible" version of the new HotPotatoes module from here:
If you decide to try it out, please let me know how you get on.