1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-14 08:21:07 +03:00

The following patch was sent to the patches list:

This patch forces the use of 'DROP VIEW' to destroy views.

It also changes the syntax of DROP VIEW to
DROP VIEW v1, v2, ...
to match the syntax of DROP TABLE.

Some error messages were changed so this patch also includes changes to the
appropriate expected/*.out files.

Doc changes for 'DROP TABLE" and 'DROP VIEW' are included.


--
Mark Hollomon
This commit is contained in:
Bruce Momjian
2000-10-18 16:16:18 +00:00
parent 60dcf13ea1
commit 73677dd92f
11 changed files with 183 additions and 153 deletions

View File

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.195 2000/10/07 00:58:17 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.196 2000/10/18 16:16:05 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -1942,15 +1942,22 @@ def_arg: func_return { $$ = (Node *)$1; }
DropStmt: DROP TABLE relation_name_list
{
DropStmt *n = makeNode(DropStmt);
n->relNames = $3;
n->sequence = FALSE;
n->names = $3;
n->removeType = DROP_TABLE;
$$ = (Node *)n;
}
| DROP SEQUENCE relation_name_list
{
DropStmt *n = makeNode(DropStmt);
n->relNames = $3;
n->sequence = TRUE;
n->names = $3;
n->removeType = DROP_SEQUENCE;
$$ = (Node *)n;
}
| DROP VIEW relation_name_list
{
DropStmt *n = makeNode(DropStmt);
n->names = $3;
n->removeType = DROP_VIEW;
$$ = (Node *)n;
}
;
@ -2558,17 +2565,16 @@ func_return: Typename
RemoveStmt: DROP remove_type name
{
RemoveStmt *n = makeNode(RemoveStmt);
DropStmt *n = makeNode(DropStmt);
n->removeType = $2;
n->name = $3;
n->names = makeList1(makeString($3));
$$ = (Node *)n;
}
;
remove_type: TYPE_P { $$ = TYPE_P; }
| INDEX { $$ = INDEX; }
| RULE { $$ = RULE; }
| VIEW { $$ = VIEW; }
remove_type: TYPE_P { $$ = DROP_TYPE_P; }
| INDEX { $$ = DROP_INDEX; }
| RULE { $$ = DROP_RULE; }
;