From 10d1c2d698c1b7cbf5af86082287adda4f0c6e97 Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Thu, 24 Sep 2020 16:18:43 +0200 Subject: [PATCH] Adjust copy code to PG13 addRTEtoQuery changes PG13 removes addRTEtoQuery and provides a similar function addNSItemToQuery which has a different signature. https://github.com/postgres/postgres/commit/5815696bc6 --- src/copy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/copy.c b/src/copy.c index 2e63dc769c5..c8ce93e60a1 100644 --- a/src/copy.c +++ b/src/copy.c @@ -535,7 +535,12 @@ copy_constraints_and_check(ParseState *pstate, Relation rel, List *attnums) { ListCell *cur; char *xactReadOnly; -#if PG12_GE +#if PG13_GE + ParseNamespaceItem *nsitem = + addRangeTableEntryForRelation(pstate, rel, RowExclusiveLock, NULL, false, false); + RangeTblEntry *rte = nsitem->p_rte; + addNSItemToQuery(pstate, nsitem, true, true, true); +#elif PG12 RangeTblEntry *rte = addRangeTableEntryForRelation(pstate, rel, RowExclusiveLock, NULL, false, false); addRTEtoQuery(pstate, rte, false, true, true);