mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Add support for temporary views, including documentation and regression
tests. Contributed by Koju Iijima, review from Neil Conway, Gavin Sherry and Tom Lane. Also, fix error in description of WITH CHECK OPTION clause in the CREATE VIEW reference page: it should be "CASCADED", not "CASCADE".
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.482 2005/01/27 03:17:59 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.483 2005/02/02 06:36:01 neilc Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@@ -4075,24 +4075,35 @@ transaction_mode_list_or_empty:
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* QUERY:
|
||||
* create view <viewname> '('target-list ')' AS <query>
|
||||
* QUERY:
|
||||
* CREATE [ OR REPLACE ] [ TEMP ] VIEW <viewname> '('target-list ')' AS <query>
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ViewStmt: CREATE opt_or_replace VIEW qualified_name opt_column_list
|
||||
ViewStmt: CREATE OptTemp VIEW qualified_name opt_column_list
|
||||
AS SelectStmt
|
||||
{
|
||||
ViewStmt *n = makeNode(ViewStmt);
|
||||
n->replace = $2;
|
||||
n->replace = false;
|
||||
n->view = $4;
|
||||
n->view->istemp = $2;
|
||||
n->aliases = $5;
|
||||
n->query = (Query *) $7;
|
||||
$$ = (Node *)n;
|
||||
$$ = (Node *) n;
|
||||
}
|
||||
| CREATE OR REPLACE OptTemp VIEW qualified_name opt_column_list
|
||||
AS SelectStmt
|
||||
{
|
||||
ViewStmt *n = makeNode(ViewStmt);
|
||||
n->replace = true;
|
||||
n->view = $6;
|
||||
n->view->istemp = $4;
|
||||
n->aliases = $7;
|
||||
n->query = (Query *) $9;
|
||||
$$ = (Node *) n;
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* QUERY:
|
||||
|
||||
Reference in New Issue
Block a user