Commit 9b6d8878 authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

There is no NULL constraint in CREATE TABLE - only NOT NULL one.

parent ed2c54b2
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.38 1997/08/21 01:34:44 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.39 1997/08/22 03:17:55 vadim Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -84,7 +84,7 @@ static Node *makeA_Expr(int oper, char *opname, Node *lexpr, Node *rexpr); ...@@ -84,7 +84,7 @@ static Node *makeA_Expr(int oper, char *opname, Node *lexpr, Node *rexpr);
Attr *attr; Attr *attr;
ColumnDef *coldef; ColumnDef *coldef;
ConstaintDef *constrdef; ConstraintDef *constrdef;
TypeName *typnam; TypeName *typnam;
DefElem *defelt; DefElem *defelt;
ParamString *param; ParamString *param;
...@@ -352,7 +352,8 @@ columnDef: Id Typename OptDefault opt_null ...@@ -352,7 +352,8 @@ columnDef: Id Typename OptDefault opt_null
} }
; ;
OptDefault: DEFAULT default_expr { OptDefault: DEFAULT default_expr
{
int deflen = CurScanPosition() - DefaultStartPosition; int deflen = CurScanPosition() - DefaultStartPosition;
char *defval; char *defval;
...@@ -453,8 +454,7 @@ default_expr_list: default_expr_or_null ...@@ -453,8 +454,7 @@ default_expr_list: default_expr_or_null
{ $$ = lappend($1, $3); } { $$ = lappend($1, $3); }
; ;
opt_null: PNULL { $$ = false; } opt_null: NOT PNULL { $$ = true; }
| NOT PNULL { $$ = true; }
| NOTNULL { $$ = true; } | NOTNULL { $$ = true; }
| /* EMPTY */ { $$ = false; } | /* EMPTY */ { $$ = false; }
; ;
...@@ -610,7 +610,7 @@ ConstraintElem: ...@@ -610,7 +610,7 @@ ConstraintElem:
; ;
ConstraintDef: CHECK a_expr { ConstraintDef: CHECK a_expr {
ConstaintDef *constr = palloc (sizeof(ConstaintDef)); ConstraintDef *constr = palloc (sizeof(ConstraintDef));
int chklen = CurScanPosition() - CheckStartPosition; int chklen = CurScanPosition() - CheckStartPosition;
char *check; char *check;
...@@ -621,7 +621,7 @@ ConstraintDef: CHECK a_expr { ...@@ -621,7 +621,7 @@ ConstraintDef: CHECK a_expr {
check[chklen] = 0; check[chklen] = 0;
constr->type = CONSTR_CHECK; constr->type = CONSTR_CHECK;
constr->name = NULL; constr->name = NULL;
constr->expr = check; constr->def = (void*) check;
$$ = constr; $$ = constr;
} }
; ;
......
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