From f46edf479e2468a08caca2a03ec7e258930a7161 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 28 May 2015 11:24:37 -0400 Subject: 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. --- src/backend/commands/functioncmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/functioncmds.c') diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 3d220e9c7e6..4accf767bbf 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -1190,11 +1190,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) { -- cgit v1.2.3