aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/functioncmds.c4
-rw-r--r--src/backend/utils/adt/ruleutils.c2
2 files changed, 4 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)
{
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 96797672396..6400fa0de3d 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -1974,6 +1974,8 @@ pg_get_functiondef(PG_FUNCTION_ARGS)
appendStringInfoString(&buf, " STRICT");
if (proc->prosecdef)
appendStringInfoString(&buf, " SECURITY DEFINER");
+ if (proc->proleakproof)
+ appendStringInfoString(&buf, " LEAKPROOF");
/* This code for the default cost and rows should match functioncmds.c */
if (proc->prolang == INTERNALlanguageId ||