Initial stab at making it buildable without pgsql

cmake -DPGSQL=0 ..

should do the trick.