Henson Choi <[email protected]> writes:
> The namespace URI in XMLNAMESPACES is a b_expr in the grammar, so an
> expression with a COLLATE clause has to be in parentheses there.
> Pretty-printed output leaves them out, so the definition of a view
> using one cannot be read back. The two attached patches add a test
> and fix it.
I'm inclined to reject this on the grounds that it depends on a false
expectation, namely that the output of pretty-print mode is guaranteed
to parse back in every case. If that were guaranteed, we would not
need the non-pretty-print mode. AFAICS the troublesome cases do work
fine in non-pretty-print mode, so this doesn't break pg_dump.
If these cases were likely to appear in the field, maybe we'd fix it
anyway, but I can't get excited about that. When would a namespace
argument be anything but a literal? The SQL spec doesn't appear
to allow anything but <character string literal> there, so we're
already going above-and-beyond by allowing b_expr. If anything,
it's a spec-compatibility bug that we tend to render the argument
as 'foo'::text and not just 'foo' (not that I'm excited about
fixing that either).
regards, tom lane