Hi Peter,
Thanks for the quick response.
> I'm curious: How did you find this bug? Did you just stumble upon it?
>
> We use postgres' ruleutils.c to build SQL strings. I realized this while I
was playing with UPSERTs on 9.5.
Does the rewritten query actually error? In other words, is your
> complaint strictly that deparsing is broken?
Yes, the rewritten query actually errors and our complaint is that a
deparsed query cannot be parsed by postgres again.
Thanks