diff --git a/plr.c b/plr.c index 68170299..c224e8f1 100755 --- a/plr.c +++ b/plr.c @@ -729,16 +729,9 @@ compile_plr_function(FunctionCallInfo fcinfo) if (function) { - bool function_valid; - /* We have a compiled function, but is it still valid? */ - if (function->fn_xmin == HeapTupleHeaderGetXmin(procTup->t_data) && - ItemPointerEquals(&function->fn_tid, &procTup->t_self)) - function_valid = true; - else - function_valid = false; - - if (!function_valid) + if (!(function->fn_xmin == HeapTupleHeaderGetXmin(procTup->t_data) && + function->fn_cmin == HeapTupleHeaderGetCmin(procTup->t_data))) { /* * Nope, drop the hashtable entry. XXX someday, free all the @@ -843,7 +836,7 @@ do_compile(FunctionCallInfo fcinfo, function->proname = pstrdup(proname); function->fn_xmin = HeapTupleHeaderGetXmin(procTup->t_data); - function->fn_tid = procTup->t_self; + function->fn_cmin = HeapTupleHeaderGetCmin(procTup->t_data); /* Lookup the pg_language tuple by Oid*/ langTup = SearchSysCache(LANGOID, diff --git a/plr.h b/plr.h index 1eefeb8d..2b71f2d8 100755 --- a/plr.h +++ b/plr.h @@ -82,11 +82,11 @@ /* working with postgres 7.3 compatible sources */ #if (CATALOG_VERSION_NO <= 200510211) -#error "This version of PL/R only builds with PostgreSQL 8.2 or later" +#error "This version of PL/R only builds with PostgreSQL 8.2" #elif (CATALOG_VERSION_NO <= 200611241) #define PG_VERSION_82_COMPAT #else -#define PG_VERSION_83_COMPAT +#error "This version of PL/R only builds with PostgreSQL 8.2" #endif #ifdef DEBUGPROTECT @@ -389,7 +389,7 @@ typedef struct plr_function { char *proname; TransactionId fn_xmin; - ItemPointerData fn_tid; + CommandId fn_cmin; plr_func_hashkey *fn_hashkey; /* back-link to hashtable key */ bool lanpltrusted; Oid result_typid;