Re: get_relation_stats_hook() - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: get_relation_stats_hook()
Date
Msg-id 87fxnsoz6r.fsf@oxford.xeocode.com
Whole thread Raw
In response to get_relation_stats_hook()  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: get_relation_stats_hook()  (Simon Riggs <simon@2ndQuadrant.com>)
Re: get_relation_stats_hook()  (Simon Riggs <simon@2ndQuadrant.com>)
Re: get_relation_stats_hook()  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Hm, I assume we want to be able to turn on and off plugins in a running
session? I think the "free_using_plugin" flag:


!             if (get_relation_stats_hook)
!                 vardata->statsTuple = (*get_relation_stats_hook) 
!                                                 (rte->relid, 
!                                                  var->varattno);
! 
!             if (vardata->statsTuple)
!                 vardata->free_using_plugin = true;                
!             else
!                 vardata->statsTuple = SearchSysCache(STATRELATT,

is insufficient to handle this. vardata->free_using_plugin could be true but
by the time the variable is released the plugin pointer could have been
cleared. Or worse, set to a different plugin.

The easiest way to fix this seems like also the best way, instead of storing a
boolean store the pointer to the release function.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's 24x7 Postgres support!


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Where to Host Project
Next
From: Heikki Linnakangas
Date:
Subject: FSM, now without WAL-logging