I have moved everything into a different file, even though it is related to “db”, because it was starting to get a bit ugly. Apparently i was doing too much work and had to read the code to understand what i was supposed to do, because pgtypes’ documentation, as all other projects from the same author, is almost non-existent.