pg_show_plans
pg_show_plans copied to clipboard
pg_show_plans_disable() is reset by each new backend startup (autovacum included)
Hello, pg_show_plans_disable() effect, is disabled after each new backend startup inside pgsp_shmem_startup(), that sets pgsp->is_enable = true;
fix proposal:
if (!found)
{
/* First time through ... */
#if PG_VERSION_NUM >= 90600
pgsp->lock = &(GetNamedLWLockTranche("pg_show_plans"))->lock;
#else
pgsp->lock = LWLockAssign();
#endif
SpinLockInit(&pgsp->elock);
} <<< to move
/* Set the initial value to is_enable */
pgsp->is_enable = true;
#if PG_VERSION_NUM >= 90500
pgsp->plan_format = plan_format;
#endif
into
if (!found)
{
/* First time through ... */
#if PG_VERSION_NUM >= 90600
pgsp->lock = &(GetNamedLWLockTranche("pg_show_plans"))->lock;
#else
pgsp->lock = LWLockAssign();
#endif
SpinLockInit(&pgsp->elock);
/* Set the initial value to is_enable */
pgsp->is_enable = true;
#if PG_VERSION_NUM >= 90500
pgsp->plan_format = plan_format;
#endif
} <<< moved
regards PAscal