Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f79b7a5

Browse files
committed
Allow use functions with no arguments in DEFAULT
Allow use IDENT as arguments of trigger functions
1 parent eec6108 commit f79b7a5

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/backend/parser/gram.y

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.48 1997/09/20 16:11:42 thomas Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.49 1997/09/24 08:31:04 vadim Exp $
1414
*
1515
* HISTORY
1616
* AUTHOR DATE MAJOR EVENT
@@ -484,6 +484,11 @@ default_expr: AexprConst
484484
$$ = nconc( $$, $3);
485485
$$ = lappend( $$, makeString(")"));
486486
}
487+
| name '(' ')'
488+
{
489+
$$ = makeList( makeString($1), makeString("("), -1);
490+
$$ = lappend( $$, makeString(")"));
491+
}
487492
| default_expr Op default_expr
488493
{
489494
if (!strcmp("<=", $2) || !strcmp(">=", $2))
@@ -841,12 +846,19 @@ TriggerFuncArgs: TriggerFuncArg
841846
;
842847

843848
TriggerFuncArg: ICONST
844-
{
849+
{
845850
char *s = (char *) palloc (256);
846851
sprintf (s, "%d", $1);
847852
$$ = s;
848-
}
853+
}
854+
| FCONST
855+
{
856+
char *s = (char *) palloc (256);
857+
sprintf (s, "%g", $1);
858+
$$ = s;
859+
}
849860
| Sconst { $$ = $1; }
861+
| IDENT { $$ = $1; }
850862
;
851863

852864
DropTrigStmt: DROP TRIGGER name ON relation_name

0 commit comments

Comments
 (0)