Fix pgsql8 quoting issues