Re: add queryEnv to ExplainOneQuery_hook

2018-03-13 Thread Tom Lane
Michael Paquier writes: > On Wed, Mar 14, 2018 at 05:36:26PM +1300, Thomas Munro wrote: >> Hmm. I suppose we could have invented a new extended hook with a >> different name and back-patched it so that PG10 would support both. >> Then binary compatibility with existing compiled extensions wouldn'

Re: add queryEnv to ExplainOneQuery_hook

2018-03-13 Thread Michael Paquier
On Wed, Mar 14, 2018 at 05:36:26PM +1300, Thomas Munro wrote: > Hmm. I suppose we could have invented a new extended hook with a > different name and back-patched it so that PG10 would support both. > Then binary compatibility with existing compiled extensions wouldn't > be affected AFAICS, but yo

Re: add queryEnv to ExplainOneQuery_hook

2018-03-13 Thread Thomas Munro
On Wed, Mar 14, 2018 at 2:57 PM, Jim Finnerty wrote: > Passing NULL in place of queryEnv in PG10 causes a failure in installcheck > tests portals and plpgsql. > > For PG10, if you want a both an ExplainOneQuery hook and clean run of > installcheck, is there a better workaround than to (a) pass NUL

Re: add queryEnv to ExplainOneQuery_hook

2018-01-11 Thread Michael Paquier
On Fri, Jan 12, 2018 at 10:43:40AM +0900, Tatsuro Yamada wrote: > Thanks guys! :) > > I also surprised that there is no complaint from extension creators. > I suppose that if possible, it would be better to create a unit test > for the hook function to avoid the same bug because there is no contri

Re: add queryEnv to ExplainOneQuery_hook

2018-01-11 Thread Tatsuro Yamada
On 2018/01/12 2:02, Tom Lane wrote: Thomas Munro writes: On Fri, Jan 12, 2018 at 12:16 AM, Tatsuro Yamada wrote: I found a variable (queryEnv) which should be added in ExplainOneQuery_hook because if it is missing, hook function can't call ExplainOnePlan. Yeah, I think you're right. That'

Re: add queryEnv to ExplainOneQuery_hook

2018-01-11 Thread Tatsuro Yamada
On 2018/01/11 21:46, Michael Paquier wrote: I'm surprised we haven't heard any complaints sooner if there are advisors using that hook[1] and expecting to be able to forward to ExplainOnePlan(), but I suppose it would nearly always works to call ExplainOnePlan() with NULL as queryEnv. It'd curre

Re: add queryEnv to ExplainOneQuery_hook

2018-01-11 Thread Tom Lane
Thomas Munro writes: > On Fri, Jan 12, 2018 at 12:16 AM, Tatsuro Yamada > wrote: >> I found a variable (queryEnv) which should be added in >> ExplainOneQuery_hook because if it is missing, hook function >> can't call ExplainOnePlan. > Yeah, I think you're right. That's an oversight in 18ce3a4a.

Re: add queryEnv to ExplainOneQuery_hook

2018-01-11 Thread Michael Paquier
On Fri, Jan 12, 2018 at 12:43:22AM +1300, Thomas Munro wrote: > Yeah, I think you're right. That's an oversight in 18ce3a4a. +1. > I'm surprised we haven't heard any complaints sooner if there are > advisors using that hook[1] and expecting to be able to forward to > ExplainOnePlan(), but I supp

Re: add queryEnv to ExplainOneQuery_hook

2018-01-11 Thread Thomas Munro
On Fri, Jan 12, 2018 at 12:16 AM, Tatsuro Yamada wrote: > I found a variable (queryEnv) which should be added in > ExplainOneQuery_hook because if it is missing, hook function > can't call ExplainOnePlan. > Sorry if this wasn't correct. > > Please find attached a patch. Yeah, I think you're right