summaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-07-15 00:01:41 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-07-15 00:01:41 +0000
commite40492ec6edafb336005bbbf271eb76e04f58f8d (patch)
treed0c13200ebc5ba718f5bb07254b9bc6a71ec3199 /src/backend/parser
parent6bfe64032efd043f80a495a495331dcfc2d9f05c (diff)
downloadpostgresql-e40492ec6edafb336005bbbf271eb76e04f58f8d.tar.gz
Remove useless and dangerous 'opt_type' option from CREATE INDEX.
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/analyze.c3
-rw-r--r--src/backend/parser/gram.y36
2 files changed, 11 insertions, 28 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 1d1cf7acf4..b5305edb54 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: analyze.c,v 1.150 2000/07/14 15:43:32 thomas Exp $
+ * $Id: analyze.c,v 1.151 2000/07/15 00:01:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -947,7 +947,6 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
iparam->name = pstrdup(column->colname);
iparam->args = NIL;
iparam->class = NULL;
- iparam->typename = NULL;
index->indexParams = lappend(index->indexParams, iparam);
if (index->idxname == NULL)
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index cf1f15ba4e..16bac38748 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.178 2000/07/14 15:43:32 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.179 2000/07/15 00:01:41 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -250,7 +250,7 @@ static void doNegateFloat(Value *v);
%type <target> target_el, update_target_el
%type <paramno> ParamNo
-%type <typnam> Typename, opt_type, SimpleTypename, ConstTypename
+%type <typnam> Typename, SimpleTypename, ConstTypename
Generic, Numeric, Character, ConstDatetime, ConstInterval, Bit
%type <str> typename, generic, numeric, character, datetime, bit
%type <str> extract_arg
@@ -1778,7 +1778,7 @@ TriggerFuncArg: ICONST
}
| FCONST { $$ = $1; }
| Sconst { $$ = $1; }
- | IDENT { $$ = $1; }
+ | ColId { $$ = $1; }
;
OptConstrFromTable: /* Empty */
@@ -2315,8 +2315,6 @@ RevokeStmt: REVOKE privileges ON relation_name_list FROM grantee
IndexStmt: CREATE index_opt_unique INDEX index_name ON relation_name
access_method_clause '(' index_params ')' opt_with
{
- /* should check that access_method is valid,
- etc ... but doesn't */
IndexStmt *n = makeNode(IndexStmt);
n->unique = $2;
n->idxname = $4;
@@ -2345,37 +2343,24 @@ index_list: index_list ',' index_elem { $$ = lappend($1, $3); }
| index_elem { $$ = lcons($1, NIL); }
;
-func_index: func_name '(' name_list ')' opt_type opt_class
+func_index: func_name '(' name_list ')' opt_class
{
$$ = makeNode(IndexElem);
$$->name = $1;
$$->args = $3;
- $$->class = $6;
- $$->typename = $5;
+ $$->class = $5;
}
;
-index_elem: attr_name opt_type opt_class
+index_elem: attr_name opt_class
{
$$ = makeNode(IndexElem);
$$->name = $1;
$$->args = NIL;
- $$->class = $3;
- $$->typename = $2;
+ $$->class = $2;
}
;
-opt_type: ':' Typename { $$ = $2; }
- | FOR Typename { $$ = $2; }
- | /*EMPTY*/ { $$ = NULL; }
- ;
-
-/* opt_class "WITH class" conflicts with preceeding opt_type
- * for Typename of "TIMESTAMP WITH TIME ZONE"
- * So, remove "WITH class" from the syntax. OK??
- * - thomas 1997-10-12
- * | WITH class { $$ = $2; }
- */
opt_class: class {
/*
* Release 7.0 removed network_ops, timespan_ops, and datetime_ops,
@@ -5352,9 +5337,9 @@ relation_name: SpecialRuleRelation
;
database_name: ColId { $$ = $1; };
-access_method: IDENT { $$ = $1; };
+access_method: ColId { $$ = $1; };
attr_name: ColId { $$ = $1; };
-class: IDENT { $$ = $1; };
+class: ColId { $$ = $1; };
index_name: ColId { $$ = $1; };
/* Functions
@@ -5365,7 +5350,6 @@ name: ColId { $$ = $1; };
func_name: ColId { $$ = xlateSqlFunc($1); };
file_name: Sconst { $$ = $1; };
-/* NOT USED recipe_name: IDENT { $$ = $1; };*/
/* Constants
* Include TRUE/FALSE for SQL3 support. - thomas 1997-10-24
@@ -5453,7 +5437,7 @@ ParamNo: PARAM opt_indirection
Iconst: ICONST { $$ = $1; };
Sconst: SCONST { $$ = $1; };
-UserId: IDENT { $$ = $1; };
+UserId: ColId { $$ = $1; };
/* Column identifier
* Include date/time keywords as SQL92 extension.