MCPcopy Create free account
hub / github.com/apache/cloudberry / plpython_validator

Function plpython_validator

src/pl/plpython/plpy_main.c:219–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219Datum
220plpython_validator(PG_FUNCTION_ARGS)
221{
222 Oid funcoid = PG_GETARG_OID(0);
223 HeapTuple tuple;
224 Form_pg_proc procStruct;
225 bool is_trigger;
226
227 if (!CheckFunctionValidatorAccess(fcinfo->flinfo->fn_oid, funcoid))
228 PG_RETURN_VOID();
229
230 if (!check_function_bodies)
231 PG_RETURN_VOID();
232
233 /* Do this only after making sure we need to do something */
234 PLy_initialize();
235
236 /* Get the new function's pg_proc entry */
237 tuple = SearchSysCache1(PROCOID, ObjectIdGetDatum(funcoid));
238 if (!HeapTupleIsValid(tuple))
239 elog(ERROR, "cache lookup failed for function %u", funcoid);
240 procStruct = (Form_pg_proc) GETSTRUCT(tuple);
241
242 is_trigger = PLy_procedure_is_trigger(procStruct);
243
244 ReleaseSysCache(tuple);
245
246 /* We can't validate triggers against any particular table ... */
247 PLy_procedure_get(funcoid, InvalidOid, is_trigger);
248
249 PG_RETURN_VOID();
250}
251
252#if PY_MAJOR_VERSION < 3
253Datum

Callers 1

plpython2_validatorFunction · 0.85

Calls 7

PLy_initializeFunction · 0.85
SearchSysCache1Function · 0.85
ObjectIdGetDatumFunction · 0.85
PLy_procedure_is_triggerFunction · 0.85
ReleaseSysCacheFunction · 0.85
PLy_procedure_getFunction · 0.85

Tested by

no test coverage detected