Handle makeDefElem changes

makeDefElem now requires the token location, but simply passing -1 to
signify "unknown" is sufficient.
pull/1439/head
Jason Petersen 2017-04-19 20:35:19 -06:00
parent 3c507e7399
commit caaaa2c9f7
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
3 changed files with 19 additions and 1 deletions

View File

@ -288,7 +288,15 @@ LoadTuplesIntoTupleStore(CitusScanState *citusScanState, Job *workerJob)
if (BinaryMasterCopyFormat)
{
DefElem *copyOption = makeDefElem("format", (Node *) makeString("binary"));
DefElem *copyOption = NULL;
#if (PG_VERSION_NUM >= 100000)
int location = -1; /* "unknown" token location */
copyOption = makeDefElem("format", (Node *) makeString("binary"), location);
#else
copyOption = makeDefElem("format", (Node *) makeString("binary"));
#endif
copyOptions = lappend(copyOptions, copyOption);
}

View File

@ -1404,6 +1404,11 @@ SetDefElemArg(AlterSeqStmt *statement, const char *name, Node *arg)
}
}
#if (PG_VERSION_NUM >= 100000)
defElem = makeDefElem((char *) name, arg, -1);
#else
defElem = makeDefElem((char *) name, arg);
#endif
statement->options = lappend(statement->options, defElem);
}

View File

@ -510,7 +510,12 @@ CopyTaskFilesFromDirectory(StringInfo schemaName, StringInfo relationName,
copyStatement = CopyStatement(relation, fullFilename->data);
if (BinaryWorkerCopyFormat)
{
#if (PG_VERSION_NUM >= 100000)
DefElem *copyOption = makeDefElem("format", (Node *) makeString("binary"),
-1);
#else
DefElem *copyOption = makeDefElem("format", (Node *) makeString("binary"));
#endif
copyStatement->options = list_make1(copyOption);
}