Re: How to keep format of views source code as entered?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: How to keep format of views source code as entered?
Дата
Msg-id CAKFQuwYWfqeZPNgTbNDfYK2iwPMYLULwW_sBvC2sQwxfK=eFUQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to keep format of views source code as entered?  (Adam Brusselback <adambrusselback@gmail.com>)
Список pgsql-general
On Wed, Jan 13, 2021 at 6:40 PM Adam Brusselback <adambrusselback@gmail.com> wrote:
 It has been a major annoyance for views with complex subqueries or where clauses, the PG representation is absolutely unreadable.

The path to a solution here is to write a schema-to-text system that presents the derived output in a more human-friendly way instead of a machine-readable way.  Or maybe write a formatter that takes the supposedly unreadable output and does stuff like "change 'character varying' to 'text'".

In any case, though, what you can do is install the view in source into a database, dump both, compare both (same version of PG), and decide whether the database version is different from the source control version and, if so, decide how to update the database.  It's a view, it's not like you get to do "alter" incremental changes anyway.

Or hold your nose and adopt a path of least resistance - accept what is easy to accomplish and be glad you aren't writing more user-friendly stuff, but that is only cosmetically different, yourself.  Learning what the canonical outputs mean is annoying but not hard, especially if you do have an original human-readable document to answer questions.

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: How to keep format of views source code as entered?
Следующее
От: Paul Förster
Дата:
Сообщение: Re: How to keep format of views source code as entered?