Skip to content

Commit af872de

Browse files
author
ANJU BHARTI
committed
fix: correct behavior of cross-database table valued functions
Signed-off-by: ANJU BHARTI <[email protected]>
1 parent 03bbf70 commit af872de

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/executor/execSRF.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "access/htup_details.h"
2222
#include "catalog/objectaccess.h"
2323
#include "catalog/pg_proc.h"
24+
#include "executor/execExpr.h"
2425
#include "funcapi.h"
2526
#include "miscadmin.h"
2627
#include "nodes/nodeFuncs.h"
@@ -701,7 +702,10 @@ init_sexpr(Oid foid, Oid input_collation, Expr *node,
701702
size_t numargs = list_length(sexpr->args);
702703

703704
/* Check permission to call function */
704-
aclresult = object_aclcheck(ProcedureRelationId, foid, GetUserId(), ACL_EXECUTE);
705+
if (ExecFuncProc_AclCheck_hook)
706+
aclresult = ExecFuncProc_AclCheck_hook(foid);
707+
else
708+
aclresult = object_aclcheck(ProcedureRelationId, foid, GetUserId(), ACL_EXECUTE);
705709
if (aclresult != ACLCHECK_OK)
706710
aclcheck_error(aclresult, OBJECT_FUNCTION, get_func_name(foid));
707711
InvokeFunctionExecuteHook(foid);

0 commit comments

Comments
 (0)