Search Postgresql Archives

Preserving view source code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux