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

Commitd1557d2

Browse files
committed
Make compatible version of ProcessUtility routine
1 parentaa45c1e commitd1557d2

File tree

2 files changed

+32
-16
lines changed

2 files changed

+32
-16
lines changed

‎src/include/compat/pg_compat.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,32 @@ void McxtStatsInternal(MemoryContext context, int level,
216216
#endif
217217

218218

219+
/*
220+
* ProcessUtility
221+
*
222+
* for v10 set NULL into 'queryEnv' argument
223+
*/
224+
#ifPG_VERSION_NUM >=100000
225+
#defineProcessUtilityCompat(parsetree,queryString,context,params,dest, \
226+
completionTag) \
227+
do { \
228+
PlannedStmt *stmt = makeNode(PlannedStmt); \
229+
stmt->commandType = CMD_UTILITY; \
230+
stmt->canSetTag = true; \
231+
stmt->utilityStmt = (parsetree); \
232+
stmt->stmt_location = -1; \
233+
stmt->stmt_len = 0; \
234+
ProcessUtility(stmt, (queryString), (context), (params), NULL, \
235+
(dest), (completionTag)); \
236+
} while (0)
237+
#elifPG_VERSION_NUM >=90500
238+
#defineProcessUtilityCompat(parsetree,queryString,context,params,dest, \
239+
completionTag) \
240+
ProcessUtility((parsetree), (queryString), (context), (params), \
241+
(dest), (completionTag))
242+
#endif
243+
244+
219245
/*
220246
* pull_var_clause()
221247
*/

‎src/partition_creation.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -786,22 +786,12 @@ create_single_partition_internal(Oid parent_relid,
786786
* call will stash the objects so created into our
787787
* event trigger context.
788788
*/
789-
#ifPG_VERSION_NUM >=100000
790-
ProcessUtility(NULL,
791-
"we have to provide a query string",
792-
PROCESS_UTILITY_SUBCOMMAND,
793-
NULL,
794-
NULL,
795-
None_Receiver,
796-
NULL);
797-
#else
798-
ProcessUtility(cur_stmt,
799-
"we have to provide a query string",
800-
PROCESS_UTILITY_SUBCOMMAND,
801-
NULL,
802-
None_Receiver,
803-
NULL);
804-
#endif
789+
ProcessUtilityCompat(cur_stmt,
790+
"we have to provide a query string",
791+
PROCESS_UTILITY_SUBCOMMAND,
792+
NULL,
793+
None_Receiver,
794+
NULL);
805795
}
806796

807797
/* Update config one more time */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp