diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-05-28 11:24:37 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-05-28 11:24:37 -0400 |
commit | d4a9f5519d300aeae813a872b3c9874a7e02564b (patch) | |
tree | 551eb42aa7a5bb134c51a1933f1b0cd1e50ccfb1 /src/backend/commands/functioncmds.c | |
parent | 269cb4fbcad116d3ec497326f166b6690a6ffbd5 (diff) | |
download | postgresql-d4a9f5519d300aeae813a872b3c9874a7e02564b.tar.gz postgresql-d4a9f5519d300aeae813a872b3c9874a7e02564b.zip |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 470db5705cc..8382b1b224c 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -1134,11 +1134,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) { |