Commit 12cf9f80 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Support SERIAL column type. Expand into an integer column but mark

 is_sequence in the ColumnDef structure.
parent fddd79aa
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * 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 * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -294,7 +294,7 @@ Oid param_type(int t); /* used in parse_expr.c */ ...@@ -294,7 +294,7 @@ Oid param_type(int t); /* used in parse_expr.c */
LANCOMPILER, LISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE, LANCOMPILER, LISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE,
NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL, NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL,
RECIPE, RENAME, RESET, RETURNS, ROW, RULE, 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 VACUUM, VERBOSE, VERSION, ENCODING
/* Keywords (obsolete; retain through next version for parser - thomas 1997-12-04) */ /* Keywords (obsolete; retain through next version for parser - thomas 1997-12-04) */
...@@ -747,6 +747,19 @@ columnDef: ColId Typename ColQualifier ...@@ -747,6 +747,19 @@ columnDef: ColId Typename ColQualifier
n->defval = NULL; n->defval = NULL;
n->is_not_null = FALSE; n->is_not_null = FALSE;
n->constraints = $3; 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; $$ = (Node *)n;
} }
; ;
...@@ -4541,6 +4554,7 @@ ColId: IDENT { $$ = $1; } ...@@ -4541,6 +4554,7 @@ ColId: IDENT { $$ = $1; }
| PRIVILEGES { $$ = "privileges"; } | PRIVILEGES { $$ = "privileges"; }
| RECIPE { $$ = "recipe"; } | RECIPE { $$ = "recipe"; }
| ROW { $$ = "row"; } | ROW { $$ = "row"; }
| SERIAL { $$ = "serial"; }
| START { $$ = "start"; } | START { $$ = "start"; }
| STATEMENT { $$ = "statement"; } | STATEMENT { $$ = "statement"; }
| TIME { $$ = "time"; } | TIME { $$ = "time"; }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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[] = { ...@@ -186,6 +186,7 @@ static ScanKeyword ScanKeywords[] = {
{"second", SECOND_P}, {"second", SECOND_P},
{"select", SELECT}, {"select", SELECT},
{"sequence", SEQUENCE}, {"sequence", SEQUENCE},
{"serial", SERIAL},
{"set", SET}, {"set", SET},
{"setof", SETOF}, {"setof", SETOF},
{"show", SHOW}, {"show", SHOW},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment