diff options
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/ecpg/preproc/keywords.c | 3 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/preproc.y | 15 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/preproc/keywords.c b/src/interfaces/ecpg/preproc/keywords.c index cadaffbefc1..75676d00e90 100644 --- a/src/interfaces/ecpg/preproc/keywords.c +++ b/src/interfaces/ecpg/preproc/keywords.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.26 2000/04/08 12:20:27 meskes Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.27 2000/06/09 01:44:31 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -246,6 +246,7 @@ static ScanKeyword ScanKeywords[] = { {"truncate", TRUNCATE}, {"trusted", TRUSTED}, {"type", TYPE_P}, + {"under", UNDER}, {"union", UNION}, {"unique", UNIQUE}, {"unlisten", UNLISTEN}, diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index 96579ecc539..b09aa80c6c4 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -236,7 +236,7 @@ make_name(void) REINDEX, RENAME, RESET, RETURNS, ROW, RULE, SEQUENCE, SERIAL, SETOF, SHARE, SHOW, START, STATEMENT, STDIN, STDOUT, SYSID TEMP, TRUNCATE, TRUSTED, - UNLISTEN, UNTIL, VACUUM, VALID, VERBOSE, VERSION + UNDER, UNLISTEN, UNTIL, VACUUM, VALID, VERBOSE, VERSION /* Special keywords, not in the query language - see the "lex" file */ %token <str> IDENT SCONST Op CSTRING CVARIABLE CPP_LINE @@ -276,7 +276,7 @@ make_name(void) %type <str> Iconst Fconst Sconst TransactionStmt CreateStmt UserId %type <str> CreateAsElement OptCreateAs CreateAsList CreateAsStmt -%type <str> OptInherit key_reference comment_text ConstraintDeferrabilitySpec +%type <str> OptUnder key_reference comment_text ConstraintDeferrabilitySpec %type <str> key_match ColLabel SpecialRuleRelation ColId columnDef %type <str> ColConstraint ColConstraintElem NumericOnly FloatOnly %type <str> OptTableElementList OptTableElement TableConstraint @@ -995,7 +995,7 @@ copy_null: WITH NULL_P AS Sconst { $$ = cat2_str(make_str("with null as"), $4); *****************************************************************************/ CreateStmt: CREATE OptTemp TABLE relation_name '(' OptTableElementList ')' - OptInherit + OptUnder { $$ = cat_str(8, make_str("create"), $2, make_str("table"), $4, make_str("("), $6, make_str(")"), $8); } @@ -1192,7 +1192,8 @@ key_reference: NO ACTION { $$ = make_str("no action"); } | SET NULL_P { $$ = make_str("set null"); } ; -OptInherit: INHERITS '(' relation_name_list ')' { $$ = cat_str(3, make_str("inherits ("), $3, make_str(")")); } +OptUnder: UNDER relation_name_list { $$ = cat_str(2, make_str("under "), $2); } + | INHERITS '(' relation_name_list ')' { $$ = cat_str(3, make_str("inherits ("), $3, make_str(")")); } | /*EMPTY*/ { $$ = EMPTY; } ; @@ -2877,6 +2878,11 @@ relation_expr: relation_name /* inheritance query */ $$ = cat2_str($1, make_str("*")); } + | ONLY relation_name %prec '=' + { + /* inheritance query */ + $$ = cat2_str(make_str("ONLY "), $2); + } opt_array_bounds: '[' ']' opt_array_bounds { @@ -5081,6 +5087,7 @@ TokenId: ABSOLUTE { $$ = make_str("absolute"); } | TRIGGER { $$ = make_str("trigger"); } | TRUNCATE { $$ = make_str("truncate"); } | TRUSTED { $$ = make_str("trusted"); } + | UNDER { $$ = make_str("under"); } | UNLISTEN { $$ = make_str("unlisten"); } | UNTIL { $$ = make_str("until"); } | UPDATE { $$ = make_str("update"); } |