Fixes issue #190. Original patch by Konstantin Knizhnik.
TODO: remove similar tests from vendor/postgres testset