Re: get_relation_stats_hook()

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Postgres <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: get_relation_stats_hook()
Date: 2008-09-22 17:41:48
Message-ID: 87fxnsoz6r.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


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!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-09-22 17:43:16 FSM, now without WAL-logging
Previous Message David E. Wheeler 2008-09-22 17:13:09 Re: Where to Host Project

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2008-09-22 18:19:02 Re: get_relation_stats_hook()
Previous Message Ryan Bradetich 2008-09-22 05:30:34 Re: [PgFoundry] Unsigned Data Types [1 of 2]