Re: idea: storing view source in system catalogs - Mailing list pgsql-hackers

From Andreas Pflug
Subject Re: idea: storing view source in system catalogs
Date
Msg-id 4833DFF5.7080500@pse-consulting.de
Whole thread Raw
In response to Re: idea: storing view source in system catalogs  (Florian Pflug <fgp.phlo.org@gmail.com>)
Responses Re: idea: storing view source in system catalogs  (Hannu Krosing <hannu@krosing.net>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: "Stephen Denne"
Date:
Subject: Re: triggers on prepare, commit, rollback... ?
Next
From: "Merlin Moncure"
Date:
Subject: Re: idea: storing view source in system catalogs