mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
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.
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user