[GENERAL] Preserving view source code

2007-10-16 Thread Thomas Kellerer
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

Re: [GENERAL] Preserving view source code

2007-10-16 Thread Richard Huxton
Thomas Kellerer wrote: Hello, when I create a view, e.g.: 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

Re: [GENERAL] Preserving view source code

2007-10-16 Thread Thomas Kellerer
Richard Huxton wrote on 16.10.2007 18:59: The formatting has been removed completely and PG actually re-wrote the query. For the above example I would get: 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

Re: [GENERAL] Preserving view source code

2007-10-16 Thread Raymond O'Donnell
On 16/10/2007 18:16, Thomas Kellerer wrote: I'm maintaining a cross-platform SQL tool that also displays source code for views, triggers etc. It would have been nice if the tool could actually display the source the same way it looked when the user ran the CREATE VIEW statement (which is