diff --git a/pg_store_plans.c b/pg_store_plans.c index a8f01ca..f60b67b 100644 --- a/pg_store_plans.c +++ b/pg_store_plans.c @@ -1579,6 +1579,12 @@ pg_store_plans_internal(FunctionCallInfo fcinfo, else pstr = SHMEM_PLAN_PTR(entry); + if (pstr == NULL) + { + values[i++] = CStringGetTextDatum(""); + goto outofblock01; + } + switch (plan_format) { case PLAN_FORMAT_TEXT: @@ -1612,10 +1618,13 @@ pg_store_plans_internal(FunctionCallInfo fcinfo, pfree(mstr); /* pstr is a pointer onto pbuffer */ + } else values[i++] = CStringGetTextDatum(""); + outofblock01: + /* copy counters to a local variable to keep locking time short */ { volatile pgspEntry *e = (volatile pgspEntry *) entry;