CREATE VIEW view AS SELECT query
Use this parameter to provide the name of the new view.
Use this parameter to supply a SQL query designed to provide the columns and rows of the view.
This message is displayed if the view is successfully created.
This error is displayed if a view with the name you supplied already exists.
This error is displayed if you did not specify a column type in the view definition.
Use CREATE VIEW to define a new table view within the current database. A query rewrite retrieve rule is generated to support the use of row retrieval with the new view.
Views are read-only as of PostgreSQL 7.1.x (the most current version as of the writing of this book).
The following example demonstrates the creation of a view of all publishers whose IDs within the table are above 100.
CREATE VIEW high_id AS SELECT * FROM publishers WHERE id *gt; 100;