Re: Preserving formatting and comments in a VIEW definition - Mailing list pgsql-general

From Tom Lane
Subject Re: Preserving formatting and comments in a VIEW definition
Date
Msg-id 27753.1426438303@sss.pgh.pa.us
Whole thread Raw
In response to Preserving formatting and comments in a VIEW definition  (Robert James <srobertjames@gmail.com>)
List pgsql-general
Robert James <srobertjames@gmail.com> writes:
> When I save a VIEW, Postgres seems to convert it to a different
> format, functionally equivalent but unrecognizable (whitespace,
> comments, adds lots of casts, etc.)

> Is there any simple way to preserve my original code?

The usual suggestion is to keep your SQL code in an SCM repo, somewhere
outside the database.  Postgres itself saves views as parse trees, so
there's no way it will ever remember whitespace or comments.

            regards, tom lane


pgsql-general by date:

Previous
From: Robert James
Date:
Subject: Preserving formatting and comments in a VIEW definition
Next
From: Robert James
Date:
Subject: Re: How do I calculate the sum of a field filtered by multiple windows defined by another field?