Preserving view source code

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Preserving view source code
Дата
Msg-id ff2nae$dan$1@ger.gmane.org
обсуждение исходный текст
Ответы Re: Preserving view source code  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Hello,

when I create a view, e.g.:

CREATE VIEW my_view
AS
SELECT col1,
        col2,
        col3
FROM mytable;

And I later retrieve the view's source using "SELECT definition FROM pg_view",
the source I supplied has been altered by Postgres.

The formatting has been removed completely and PG actually re-wrote the query.
For the above example I would get:

SELECT mytable.col1, mytable.col2, mytable.col3 FROM mytable

(all in one line)

Is there a way to tell PG _not_ to alter my SQL, so I can retrieve the same (or
at least a very similar) version of the original statement?

For procedures this is already the case, so I wonder why the view code is
altered that much.

Regards
Thomas

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

Предыдущее
От: "Michael Guiard"
Дата:
Сообщение: Re: slow request
Следующее
От: brian
Дата:
Сообщение: Re: problem with a column of type timestamp