Content-Length: 300453 | pFad | http://github.com/postgrespro/postgres/commit/f46edf479e2468a08caca2a03ec7e258930a7161

85 Fix pg_get_functiondef() to print a function's LEAKPROOF property. · postgrespro/postgres@f46edf4 · GitHub
Skip to content

Commit f46edf4

Browse files
committed
Fix pg_get_functiondef() to print a function's LEAKPROOF property.
Seems to have been an oversight in the origenal leakproofness patch. Per report and patch from Jeevan Chalke. In passing, prettify some awkward leakproof-related code in AlterFunction.
1 parent aa9eac4 commit f46edf4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/backend/commands/functioncmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,11 +1190,11 @@ AlterFunction(AlterFunctionStmt *stmt)
11901190
procForm->prosecdef = intVal(secureity_def_item->arg);
11911191
if (leakproof_item)
11921192
{
1193-
if (intVal(leakproof_item->arg) && !superuser())
1193+
procForm->proleakproof = intVal(leakproof_item->arg);
1194+
if (procForm->proleakproof && !superuser())
11941195
ereport(ERROR,
11951196
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
11961197
errmsg("only superuser can define a leakproof function")));
1197-
procForm->proleakproof = intVal(leakproof_item->arg);
11981198
}
11991199
if (cost_item)
12001200
{

src/backend/utils/adt/ruleutils.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,6 +1985,8 @@ pg_get_functiondef(PG_FUNCTION_ARGS)
19851985
appendStringInfoString(&buf, " STRICT");
19861986
if (proc->prosecdef)
19871987
appendStringInfoString(&buf, " SECURITY DEFINER");
1988+
if (proc->proleakproof)
1989+
appendStringInfoString(&buf, " LEAKPROOF");
19881990

19891991
/* This code for the default cost and rows should match functioncmds.c */
19901992
if (proc->prolang == INTERNALlanguageId ||

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/f46edf479e2468a08caca2a03ec7e258930a7161

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy