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!

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to