fix a quoting typo in ks_postgresql, DRY up