From 8f60f43f2e23add472acd988741411e025bff87d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 2 Sep 2002 20:04:40 +0000 Subject: Department of second thoughts: make checks for replacing a view slightly more flexible, and improve the error reporting. Also, add documentation for REPLACE RULE/VIEW. --- doc/src/sgml/ref/create_view.sgml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'doc/src/sgml/ref/create_view.sgml') diff --git a/doc/src/sgml/ref/create_view.sgml b/doc/src/sgml/ref/create_view.sgml index aa7c869285..1692f9f0f7 100644 --- a/doc/src/sgml/ref/create_view.sgml +++ b/doc/src/sgml/ref/create_view.sgml @@ -1,5 +1,5 @@ @@ -21,7 +21,7 @@ PostgreSQL documentation 2000-03-25 -CREATE VIEW view [ ( view [ ( column name list ) ] AS SELECT query @@ -132,13 +132,21 @@ CREATE VIEW vista AS SELECT text 'Hello World' Description + - CREATE VIEW will define a view of a query. + CREATE VIEW defines a view of a query. The view is not physically materialized. Instead, a query rewrite rule (an ON SELECT rule) is automatically generated to support SELECT operations on views. + + CREATE OR REPLACE VIEW is similar, but if a view + of the same name already exists, it is replaced. You can only replace + a view with a new query that generates the identical set of columns + (i.e., same column names and data types). + + If a schema name is given (for example, CREATE VIEW myschema.myview ...) then the view is created in the @@ -206,6 +214,7 @@ SELECT * FROM kinds; SQL92 + SQL92 specifies some additional capabilities for the CREATE VIEW statement: @@ -253,6 +262,12 @@ CREATE VIEW view [ + + + CREATE OR REPLACE VIEW is a + PostgreSQL language extension. + + -- cgit v1.2.1