Question about ExplainOneQuery_hook
- Jump to email@example.comT21:00:57+00:00Hi, I was looking at ExplainOneQuery() where ExplainOneQuery_hook is called. Currently the call to the hook is in if block and normal processing is in else block. What if the hook doesn't want to duplicate the whole code printing execution plan ? Please advise. Thanks
- Jump to firstname.lastname@example.orgT22:58:11+00:00On Tue, Jul 26, 2022 at 1:54 PM Zhihong Yu <email@example.com> wrote: > Hi, > I was looking at ExplainOneQuery() where ExplainOneQuery_hook is called. > > Currently the call to the hook is in if block and normal processing is in > else block. > > What if the hook doesn't want to duplicate the whole code printing > execution plan ? > > Please advise. > > What kind of advice are you looking for, especially knowing we don't know anything except you find the existing hook unusable. https://github.com/postgres/postgres/commit/604ffd280b955100e5fc24649ee4d42a6f3ebf35 My advice is pretend the hook doesn't even exist since it was created 15 years ago for a specific purpose that isn't what you are doing. I'm hoping that you already have some idea of how to interact with the open source PostgreSQL project when it doesn't have a feature that you want. Otherwise that generic discussion probably is best done on -general with a better subject line. David J.