Thanks for updated patch, it is working fine on my machine. I have tested it couple of times.
I've tested it a couple of times and still see the pgDataType failure. I've attached the screenshot; I have to wonder why that test is throwing a syntax error at all as it's only supposed to test that we display different datatypes correctly. Looking further, it seems that it's trying to execute a badly corrupted query. How did it get that way? Do we need to clear the CodeMirror box before trying to replace the query?