summaryrefslogtreecommitdiff
path: root/src/backend/commands/functioncmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-05-28 11:24:37 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2015-05-28 11:24:37 -0400
commitf3c67aad433484cab9c997a99965992c0ffbdbe5 (patch)
tree170c0a13b71857d81009ce2d4c68a1fbfb1d5ca5 /src/backend/commands/functioncmds.c
parent44674d071f69ed0f9e076bffa9b5386dbede332e (diff)
Fix pg_get_functiondef() to print a function's LEAKPROOF property.
Seems to have been an oversight in the original leakproofness patch. Per report and patch from Jeevan Chalke. In passing, prettify some awkward leakproof-related code in AlterFunction.
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 998357b154d..166c7ce2408 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -1314,11 +1314,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)
{