<phrase>where <replaceable class="PARAMETER">action</replaceable> is one of:</phrase>
CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT
- IMMUTABLE | STABLE | VOLATILE | LEAKPROOF
+ IMMUTABLE | STABLE | VOLATILE | [ NOT ] LEAKPROOF
[ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER
COST <replaceable class="parameter">execution_cost</replaceable>
ROWS <replaceable class="parameter">result_rows</replaceable>
| RETURNS TABLE ( <replaceable class="parameter">column_name</replaceable> <replaceable class="parameter">column_type</replaceable> [, ...] ) ]
{ LANGUAGE <replaceable class="parameter">lang_name</replaceable>
| WINDOW
- | IMMUTABLE | STABLE | VOLATILE | LEAKPROOF
+ | IMMUTABLE | STABLE | VOLATILE | [ NOT ] LEAKPROOF
| CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT
| [ EXTERNAL ] SECURITY INVOKER | [ EXTERNAL ] SECURITY DEFINER
| COST <replaceable class="parameter">execution_cost</replaceable>
%type <istmt> insert_rest
-%type <vsetstmt> set_rest SetResetClause
+%type <vsetstmt> set_rest set_rest_more SetResetClause FunctionSetResetClause
%type <node> TableElement TypedTableElement ConstraintElem TableFuncElement
ForeignTableElement
}
;
-set_rest: /* Generic SET syntaxes: */
+set_rest:
+ TRANSACTION transaction_mode_list
+ {
+ VariableSetStmt *n = makeNode(VariableSetStmt);
+ n->kind = VAR_SET_MULTI;
+ n->name = "TRANSACTION";
+ n->args = $2;
+ $$ = n;
+ }
+ | SESSION CHARACTERISTICS AS TRANSACTION transaction_mode_list
+ {
+ VariableSetStmt *n = makeNode(VariableSetStmt);
+ n->kind = VAR_SET_MULTI;
+ n->name = "SESSION CHARACTERISTICS";
+ n->args = $5;
+ $$ = n;
+ }
+ | set_rest_more
+ ;
+
+set_rest_more: /* Generic SET syntaxes: */
var_name TO var_list
{
VariableSetStmt *n = makeNode(VariableSetStmt);
n->kind = VAR_SET_DEFAULT;
$$ = n;
}
- | TRANSACTION transaction_mode_list
- {
- VariableSetStmt *n = makeNode(VariableSetStmt);
- n->kind = VAR_SET_MULTI;
- n->name = "TRANSACTION";
- n->args = $2;
- $$ = n;
- }
- | SESSION CHARACTERISTICS AS TRANSACTION transaction_mode_list
- {
- VariableSetStmt *n = makeNode(VariableSetStmt);
- n->kind = VAR_SET_MULTI;
- n->name = "SESSION CHARACTERISTICS";
- n->args = $5;
- $$ = n;
- }
| CATALOG_P Sconst
{
ereport(ERROR,
| VariableResetStmt { $$ = (VariableSetStmt *) $1; }
;
+/* SetResetClause allows SET or RESET without LOCAL */
+FunctionSetResetClause:
+ SET set_rest_more { $$ = $2; }
+ | VariableResetStmt { $$ = (VariableSetStmt *) $1; }
+ ;
+
VariableShowStmt:
SHOW var_name
{
$$ = makeDefElem("leakproof", (Node *)makeInteger(TRUE));
}
+ | NOT LEAKPROOF
+ {
+ $$ = makeDefElem("leakproof", (Node *)makeInteger(FALSE));
+ }
| COST NumericOnly
{
$$ = makeDefElem("cost", (Node *)$2);
{
$$ = makeDefElem("rows", (Node *)$2);
}
- | SetResetClause
+ | FunctionSetResetClause
{
/* we abuse the normal content of a DefElem here */
$$ = makeDefElem("set", (Node *)$1);