Stephen Frost <sfrost@snowman.net> writes:
> We're talking about a quote-everything option, not what quote_ident()
> does today. I don't see why that needs to be done by the backend or why
> pg_dump/pg_restore doesn't have enough info to handle that.
Are you proposing to stick a SQL parser into pg_dump so that it can
split apart view and expression definitions to tell what is an
identifier and what isn't?
BTW, it wouldn't be just one parser, but a different one for each back
version supported by pg_dump, else you'll fail on exactly the cases that
are of concern here.
regards, tom lane