plpython.patch

text/x-patch

Filename: plpython.patch
Type: text/x-patch
Part: 0
Message: Re: why does plperl cache functions using just a bool for is_trigger

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
File+
src/pl/plpython/plpython.c 7 0
*** a/src/pl/plpython/plpython.c
--- b/src/pl/plpython/plpython.c
***************
*** 1298,1304 **** PLy_procedure_get(FunctionCallInfo fcinfo, Oid tgreloid)
  	if (!HeapTupleIsValid(procTup))
  		elog(ERROR, "cache lookup failed for function %u", fn_oid);
  
! 	rv = snprintf(key, sizeof(key), "%u_%u", fn_oid, tgreloid);
  	if (rv >= sizeof(key) || rv < 0)
  		elog(ERROR, "key too long");
  
--- 1298,1308 ----
  	if (!HeapTupleIsValid(procTup))
  		elog(ERROR, "cache lookup failed for function %u", fn_oid);
  
! 	if(OidIsValid(tgreloid))
! 		rv = snprintf(key, sizeof(key), "%u_trigger", fn_oid);
! 	else
! 		rv = snprintf(key, sizeof(key), "%u", fn_oid);
! 
  	if (rv >= sizeof(key) || rv < 0)
  		elog(ERROR, "key too long");
  
***************
*** 1365,1374 **** PLy_procedure_create(HeapTuple procTup, Oid tgreloid, char *key)
  
  	if (OidIsValid(tgreloid))
  		rv = snprintf(procName, sizeof(procName),
! 					  "__plpython_procedure_%s_%u_trigger_%u",
  					  NameStr(procStruct->proname),
! 					  HeapTupleGetOid(procTup),
! 					  tgreloid);
  	else
  		rv = snprintf(procName, sizeof(procName),
  					  "__plpython_procedure_%s_%u",
--- 1369,1377 ----
  
  	if (OidIsValid(tgreloid))
  		rv = snprintf(procName, sizeof(procName),
! 					  "__plpython_procedure_%s_%u_trigger",
  					  NameStr(procStruct->proname),
! 					  HeapTupleGetOid(procTup));
  	else
  		rv = snprintf(procName, sizeof(procName),
  					  "__plpython_procedure_%s_%u",