Florian Pflug wrote:
But maybe you could store the whitespace appearing before (or after?) a token in the parse tree that is stored for a view. That might not allow reconstructing the *precise* statement, but at least the reconstructed statement would preserve newlines and indention - which probably is the whole reason for wanting to store the original statement in the first place, no? I
Not the whole reason. To get a view definition that is more readable, the pretty_bool option of pg_get_viewdef already does some newline and indent formatting. Not the initial formatting, but Good Enough (TM), I believe.
What's really lost is any comment that might have existed in the initial source. I previously had the idea to invent comment nodes, but never came to implement them.
Regards, Andreas -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers