Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/backend/parser/parse_clause.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ sortby_nulls_hook_type sortby_nulls_hook = NULL;

optimize_explicit_cast_hook_type optimize_explicit_cast_hook = NULL;

pre_transform_openxml_columns_hook_type pre_transform_openxml_columns_hook = NULL;

static int extractRemainingColumns(ParseState *pstate,
ParseNamespaceColumn *src_nscolumns,
List *src_colnames,
Expand Down Expand Up @@ -711,6 +713,13 @@ transformRangeTableFunc(ParseState *pstate, RangeTableFunc *rtf)
constructName = "XMLTABLE";
docType = XMLOID;

/*
* Hook to allow extensions to pre-process OPENXML column definitions
* before standard XMLTABLE transformation.
*/
if (pre_transform_openxml_columns_hook)
pre_transform_openxml_columns_hook(pstate, rtf);

/*
* We make lateral_only names of this level visible, whether or not the
* RangeTableFunc is explicitly marked LATERAL. This is needed for SQL
Expand Down
4 changes: 4 additions & 0 deletions src/include/parser/parse_clause.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,8 @@ extern PGDLLEXPORT optimize_explicit_cast_hook_type optimize_explicit_cast_hook;
/* functions in parse_jsontable.c */
extern ParseNamespaceItem *transformJsonTable(ParseState *pstate, JsonTable *jt);

/* Hook for preprocessing OPENXML column definitions before XMLTABLE transformation */
typedef void (*pre_transform_openxml_columns_hook_type) (ParseState *pstate, RangeTableFunc *rtf);
extern PGDLLEXPORT pre_transform_openxml_columns_hook_type pre_transform_openxml_columns_hook;

#endif /* PARSE_CLAUSE_H */