mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-05 19:09:58 +08:00
Support SERIAL column type. Expand into an integer column but mark
is_sequence in the ColumnDef structure.
This commit is contained in:
parent
fddd79aa73
commit
12cf9f8075
@ -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"; }
|
||||
|
@ -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},
|
||||
|
Loading…
Reference in New Issue
Block a user