Hello Please post your answers to the list.
You need to drop the view before recreating it. Then it works. If you changed the access to the view with grants or revokes, you also neet to recreate them. They are dropped with the view. Sorry to say but If we need to drop and replace then what is use of "Create OR Replace " syntax?
I am not sure about the concrete rationale behind it, but the replacement of a view is useful when you make changes in the way how you select data from different tables without changing the structure of the record returned by the view. In our company views are used a.o. as interfaces to applications. They may change during development, but later on they become stable. If the design of the tables behind the view changes you may need to change the body of the view leaving the interface the same. In this way you can optimize performance in the database without forcing application developers to make changes to their code.
Besides, dropping and creating a view costs nothing in terms of performance.
If its not a bug and a limitation kindly guide me towards any documentation where it is mentioned. http://www.postgresql.org/docs/current/static/sql-createview.html CREATE OR REPLACE VIEW is similar, but if a view of the same name already exists, it is replaced. The new query must generate the same columns that were generated by the existing view query (that is, the same column names in the same order and with the same data types), but it may add additional columns to the end of the list. The calculations giving rise to the output columns may be completely different. If this is the limitation. Is community is planning update this or add this feature soon?
Unfortunately I have no answer to that, but somebody else may. Regards Charles
-- Thanks and Regards, Sachin Kotwal
-- Swiss PostgreSQL Users Group c/o Charles Clavadetscher Motorenstrasse 18 CH - 8005 Zürich http://www.swisspug.org -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general