mirror of https://github.com/citusdata/citus.git
Introduces CopyFromState_compat macro
CopyState struct is divided into parts and one of them is CopyFromState This macro uses the appropriate one for PG versions Relevant PG commit: c532d15dddff14b01fe9ef1d465013cb8ef186dftalha_pg14_support
parent
9c59290434
commit
9c3a4b6296
|
@ -213,7 +213,7 @@ DoLocalCopy(StringInfo buffer, Oid relationId, int64 shardId, CopyStmt *copyStat
|
|||
/* p_rtable of pState is set so that we can check constraints. */
|
||||
pState->p_rtable = CreateRangeTable(shard, ACL_INSERT);
|
||||
|
||||
CopyState cstate = BeginCopyFrom(pState, shard, NULL, false,
|
||||
CopyFromState_compat cstate = BeginCopyFrom(pState, shard, NULL, false,
|
||||
ReadFromLocalBufferCallback,
|
||||
copyStatement->attlist, copyStatement->options);
|
||||
CopyFrom(cstate);
|
||||
|
|
|
@ -520,7 +520,7 @@ CopyToExistingShards(CopyStmt *copyStatement, QueryCompletionCompat *completionT
|
|||
}
|
||||
|
||||
/* initialize copy state to read from COPY data source */
|
||||
CopyState copyState = BeginCopyFrom(NULL,
|
||||
CopyFromState_compat copyState = BeginCopyFrom(NULL,
|
||||
copiedDistributedRelation,
|
||||
copyStatement->filename,
|
||||
copyStatement->is_program,
|
||||
|
@ -617,7 +617,7 @@ CopyToNewShards(CopyStmt *copyStatement, QueryCompletionCompat *completionTag, O
|
|||
(ShardConnections *) palloc0(sizeof(ShardConnections));
|
||||
|
||||
/* initialize copy state to read from COPY data source */
|
||||
CopyState copyState = BeginCopyFrom(NULL,
|
||||
CopyFromState_compat copyState = BeginCopyFrom(NULL,
|
||||
distributedRelation,
|
||||
copyStatement->filename,
|
||||
copyStatement->is_program,
|
||||
|
|
|
@ -410,7 +410,7 @@ ReadFileIntoTupleStore(char *fileName, char *copyFormat, TupleDesc tupleDescript
|
|||
location);
|
||||
copyOptions = lappend(copyOptions, copyOption);
|
||||
|
||||
CopyState copyState = BeginCopyFrom(NULL, stubRelation, fileName, false, NULL,
|
||||
CopyFromState_compat copyState = BeginCopyFrom(NULL, stubRelation, fileName, false, NULL,
|
||||
NULL, copyOptions);
|
||||
|
||||
while (true)
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#define VACOPTVALUE_DISABLED_COMPAT VACOPTVALUE_DISABLED
|
||||
#define VACOPTVALUE_ENABLED_COMPAT VACOPTVALUE_ENABLED
|
||||
#define IsReindexWithParam_compat(reindex, param) IsReindexWithParam(reindex, param)
|
||||
#define CopyFromState_compat CopyFromState
|
||||
#else
|
||||
#define AlterTableStmtObjType(a) ((a)->relkind)
|
||||
#define F_NEXTVAL_COMPAT F_NEXTVAL_OID
|
||||
|
@ -69,6 +70,7 @@
|
|||
((strcmp(param, "concurrently") == 0) ? ((reindex)->concurrent) : \
|
||||
((strcmp(param, "verbose") == 0) ? ((reindex)->options == REINDEXOPT_VERBOSE) : \
|
||||
false))
|
||||
#define CopyFromState_compat CopyState
|
||||
#endif
|
||||
|
||||
#if PG_VERSION_NUM >= PG_VERSION_13
|
||||
|
|
Loading…
Reference in New Issue