]> granicus.if.org Git - postgresql/commitdiff
Support SERIAL column type. Expand into an integer column but mark
authorThomas G. Lockhart <lockhart@fourpalms.org>
Tue, 25 Aug 1998 15:04:24 +0000 (15:04 +0000)
committerThomas G. Lockhart <lockhart@fourpalms.org>
Tue, 25 Aug 1998 15:04:24 +0000 (15:04 +0000)
 is_sequence in the ColumnDef structure.

src/backend/parser/gram.y
src/backend/parser/keywords.c

index a81f0f6a35a933069319f2f8b3e236a8d7704e06..bdbe286d21f177633ed97943887c79074c05dc95 100644 (file)
@@ -10,7 +10,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.24 1998/08/24 01:13:44 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.25 1998/08/25 15:04:23 thomas Exp $
  *
  * HISTORY
  *       AUTHOR                        DATE                    MAJOR EVENT
@@ -294,7 +294,7 @@ Oid param_type(int t); /* used in parse_expr.c */
                LANCOMPILER, LISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE,
                NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL,
                RECIPE, RENAME, RESET, RETURNS, ROW, RULE,
-               SEQUENCE, SETOF, SHOW, START, STATEMENT, STDIN, STDOUT, TRUSTED, 
+               SEQUENCE, SERIAL, SETOF, SHOW, START, STATEMENT, STDIN, STDOUT, TRUSTED, 
                VACUUM, VERBOSE, VERSION, ENCODING
 
 /* Keywords (obsolete; retain through next version for parser - thomas 1997-12-04) */
@@ -747,6 +747,19 @@ columnDef:  ColId Typename ColQualifier
                                        n->defval = NULL;
                                        n->is_not_null = FALSE;
                                        n->constraints = $3;
+                                       $$ = (Node *)n;
+                               }
+                       | ColId SERIAL
+                               {
+                                       ColumnDef *n = makeNode(ColumnDef);
+                                       n->colname = $1;
+                                       n->typename = makeNode(TypeName);
+                                       n->typename->name = xlateSqlType("integer");
+                                       n->defval = NULL;
+                                       n->is_not_null = TRUE;
+                                       n->is_sequence = TRUE;
+                                       n->constraints = NULL;
+
                                        $$ = (Node *)n;
                                }
                ;
@@ -4541,6 +4554,7 @@ ColId:  IDENT                                                     { $$ = $1; }
                | PRIVILEGES                                    { $$ = "privileges"; }
                | RECIPE                                                { $$ = "recipe"; }
                | ROW                                                   { $$ = "row"; }
+               | SERIAL                                                { $$ = "serial"; }
                | START                                                 { $$ = "start"; }
                | STATEMENT                                             { $$ = "statement"; }
                | TIME                                                  { $$ = "time"; }
index 383696f5675b35cf366f8bd2cf0a2bf1018df40f..f04dbf63573717da105539076a40e64de78669e7 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.40 1998/08/24 01:39:18 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.41 1998/08/25 15:04:24 thomas Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -186,6 +186,7 @@ static ScanKeyword ScanKeywords[] = {
        {"second", SECOND_P},
        {"select", SELECT},
        {"sequence", SEQUENCE},
+       {"serial", SERIAL},
        {"set", SET},
        {"setof", SETOF},
        {"show", SHOW},