aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/functioncmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/functioncmds.c')
-rw-r--r--src/backend/commands/functioncmds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index eef78498ba6..5915cd7acb3 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -1103,11 +1103,11 @@ AlterFunction(AlterFunctionStmt *stmt)
procForm->prosecdef = intVal(security_def_item->arg);
if (leakproof_item)
{
- if (intVal(leakproof_item->arg) && !superuser())
+ procForm->proleakproof = intVal(leakproof_item->arg);
+ if (procForm->proleakproof && !superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("only superuser can define a leakproof function")));
- procForm->proleakproof = intVal(leakproof_item->arg);
}
if (cost_item)
{