Fix regression test issues

Modify regression tests so that it works on pg versions < 9.2
Regression tests work cleanly till 8.3.
More work is required for 8.2 and 8.1.
Fix regression tests in 8.2
Merge pull request #9 from b-emerson/master

Fix regression test issues till 8.2