Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org> writes:
> The view itself works, so it must be the pretty
> printer that is broken (where ever that is hidden away in the code).
Yeah, I think this is due to overenthusiastic removal of parentheses.
I believe if you pg_dump the view you will get a correctly parenthesized
version, because pg_dump does not trust the pretty printer (for reasons
that should now be obvious...)
regards, tom lane