summaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw
diff options
context:
space:
mode:
authorAndres Freund2019-01-21 18:32:19 +0000
committerAndres Freund2019-01-21 18:51:37 +0000
commite0c4ec07284db817e1f8d9adfb3fffc952252db0 (patch)
treead56d635b246f6d4d0d7a17b2a4ac797d7227b62 /contrib/postgres_fdw
parent111944c5ee567f1c45bf0f1ecfdec682af467aa6 (diff)
Replace uses of heap_open et al with the corresponding table_* function.
Author: Andres Freund Discussion: https://postgr.es/m/20190111000539.xbv7s6w7ilcvm7dp@alap3.anarazel.de
Diffstat (limited to 'contrib/postgres_fdw')
-rw-r--r--contrib/postgres_fdw/deparse.c12
-rw-r--r--contrib/postgres_fdw/postgres_fdw.c8
2 files changed, 10 insertions, 10 deletions
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c
index 20982daef68..f368d4b31fb 100644
--- a/contrib/postgres_fdw/deparse.c
+++ b/contrib/postgres_fdw/deparse.c
@@ -1048,11 +1048,11 @@ deparseSelectSql(List *tlist, bool is_subquery, List **retrieved_attrs,
* Core code already has some lock on each rel being planned, so we
* can use NoLock here.
*/
- Relation rel = heap_open(rte->relid, NoLock);
+ Relation rel = table_open(rte->relid, NoLock);
deparseTargetList(buf, rte, foreignrel->relid, rel, false,
fpinfo->attrs_used, false, retrieved_attrs);
- heap_close(rel, NoLock);
+ table_close(rel, NoLock);
}
}
@@ -1543,7 +1543,7 @@ deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel,
* Core code already has some lock on each rel being planned, so we
* can use NoLock here.
*/
- Relation rel = heap_open(rte->relid, NoLock);
+ Relation rel = table_open(rte->relid, NoLock);
deparseRelation(buf, rel);
@@ -1555,7 +1555,7 @@ deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel,
if (use_alias)
appendStringInfo(buf, " %s%d", REL_ALIAS_PREFIX, foreignrel->relid);
- heap_close(rel, NoLock);
+ table_close(rel, NoLock);
}
}
@@ -2097,7 +2097,7 @@ deparseColumnRef(StringInfo buf, int varno, int varattno, RangeTblEntry *rte,
* The lock on the relation will be held by upper callers, so it's
* fine to open it with no lock here.
*/
- rel = heap_open(rte->relid, NoLock);
+ rel = table_open(rte->relid, NoLock);
/*
* The local name of the foreign table can not be recognized by the
@@ -2132,7 +2132,7 @@ deparseColumnRef(StringInfo buf, int varno, int varattno, RangeTblEntry *rte,
if (qualify_col)
appendStringInfoString(buf, " END");
- heap_close(rel, NoLock);
+ table_close(rel, NoLock);
bms_free(attrs_used);
}
else
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 36ae10db115..d85a83abe98 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -1616,7 +1616,7 @@ postgresPlanForeignModify(PlannerInfo *root,
* Core code already has some lock on each rel being planned, so we can
* use NoLock here.
*/
- rel = heap_open(rte->relid, NoLock);
+ rel = table_open(rte->relid, NoLock);
/*
* In an INSERT, we transmit all columns that are defined in the foreign
@@ -1706,7 +1706,7 @@ postgresPlanForeignModify(PlannerInfo *root,
break;
}
- heap_close(rel, NoLock);
+ table_close(rel, NoLock);
/*
* Build the fdw_private list that will be available to the executor.
@@ -2121,7 +2121,7 @@ postgresPlanDirectModify(PlannerInfo *root,
* Core code already has some lock on each rel being planned, so we can
* use NoLock here.
*/
- rel = heap_open(rte->relid, NoLock);
+ rel = table_open(rte->relid, NoLock);
/*
* Recall the qual clauses that must be evaluated remotely. (These are
@@ -2207,7 +2207,7 @@ postgresPlanDirectModify(PlannerInfo *root,
rebuild_fdw_scan_tlist(fscan, returningList);
}
- heap_close(rel, NoLock);
+ table_close(rel, NoLock);
return true;
}