Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit50ba65e

Browse files
committed
Add an additional hook for EXPLAIN option validation.
Commitc65bc2e made it possible forloadable modules to add EXPLAIN options. Normally, any necessaryvalidation can be performed by the hook function passed toRegisterExtensionExplainOption, but if a loadable module wants to sanitycheck options against each other, that needs to be done after the entireoptions list has been processed. So, add an additional hook for thatpurpose.Author: Sami Imseih <samimseih@gmail.com>Reviewed-by: Robert Haas <robertmhaas@gmail.com>Reviewed-by: Andrei Lepikhov <lepihov@gmail.com>Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:http://postgr.es/m/CAA5RZ0vOcJF91O2e5AQN+V6guMNLMhJx83dxALf-iUZ-hLGO_Q@mail.gmail.com
1 parentaf0d490 commit50ba65e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

‎src/backend/commands/explain_state.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
#include"commands/explain.h"
3838
#include"commands/explain_state.h"
3939

40+
/* Hook to perform additional EXPLAIN options validation */
41+
explain_validate_options_hook_typeexplain_validate_options_hook=NULL;
42+
4043
typedefstruct
4144
{
4245
constchar*option_name;
@@ -196,6 +199,10 @@ ParseExplainOptionList(ExplainState *es, List *options, ParseState *pstate)
196199

197200
/* if the summary was not set explicitly, set default value */
198201
es->summary= (summary_set) ?es->summary :es->analyze;
202+
203+
/* plugin specific option validation */
204+
if (explain_validate_options_hook)
205+
(*explain_validate_options_hook) (es,options,pstate);
199206
}
200207

201208
/*

‎src/include/commands/explain_state.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ typedef struct ExplainState
7878

7979
typedefvoid (*ExplainOptionHandler) (ExplainState*,DefElem*,ParseState*);
8080

81+
/* Hook to perform additional EXPLAIN options validation */
82+
typedefvoid (*explain_validate_options_hook_type) (structExplainState*es,List*options,
83+
ParseState*pstate);
84+
externPGDLLIMPORTexplain_validate_options_hook_typeexplain_validate_options_hook;
85+
8186
externExplainState*NewExplainState(void);
8287
externvoidParseExplainOptionList(ExplainState*es,List*options,
8388
ParseState*pstate);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp