1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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
This commit is contained in:
Andres Freund
2019-01-21 10:32:19 -08:00
parent 111944c5ee
commit e0c4ec0728
114 changed files with 1259 additions and 1259 deletions

View File

@ -180,7 +180,7 @@ AcquireRewriteLocks(Query *parsetree,
else
lockmode = rte->rellockmode;
rel = heap_open(rte->relid, lockmode);
rel = table_open(rte->relid, lockmode);
/*
* While we have the relation open, update the RTE's relkind,
@ -188,7 +188,7 @@ AcquireRewriteLocks(Query *parsetree,
*/
rte->relkind = rel->rd_rel->relkind;
heap_close(rel, NoLock);
table_close(rel, NoLock);
break;
case RTE_JOIN:
@ -1813,7 +1813,7 @@ fireRIRrules(Query *parsetree, List *activeRIRs)
* We can use NoLock here since either the parser or
* AcquireRewriteLocks should have locked the rel already.
*/
rel = heap_open(rte->relid, NoLock);
rel = table_open(rte->relid, NoLock);
/*
* Collect the RIR rules that we must apply
@ -1860,7 +1860,7 @@ fireRIRrules(Query *parsetree, List *activeRIRs)
}
}
heap_close(rel, NoLock);
table_close(rel, NoLock);
}
/* Recurse into subqueries in WITH */
@ -1904,7 +1904,7 @@ fireRIRrules(Query *parsetree, List *activeRIRs)
rte->relkind != RELKIND_PARTITIONED_TABLE))
continue;
rel = heap_open(rte->relid, NoLock);
rel = table_open(rte->relid, NoLock);
/*
* Fetch any new security quals that must be applied to this RTE.
@ -1979,7 +1979,7 @@ fireRIRrules(Query *parsetree, List *activeRIRs)
if (hasSubLinks)
parsetree->hasSubLinks = true;
heap_close(rel, NoLock);
table_close(rel, NoLock);
}
return parsetree;
@ -2896,7 +2896,7 @@ rewriteTargetView(Query *parsetree, Relation view)
* already have the right lock!) Since it will become the query target
* relation, RowExclusiveLock is always the right thing.
*/
base_rel = heap_open(base_rte->relid, RowExclusiveLock);
base_rel = table_open(base_rte->relid, RowExclusiveLock);
/*
* While we have the relation open, update the RTE's relkind, just in case
@ -3281,7 +3281,7 @@ rewriteTargetView(Query *parsetree, Relation view)
}
}
heap_close(base_rel, NoLock);
table_close(base_rel, NoLock);
return parsetree;
}
@ -3391,7 +3391,7 @@ RewriteQuery(Query *parsetree, List *rewrite_events)
* We can use NoLock here since either the parser or
* AcquireRewriteLocks should have locked the rel already.
*/
rt_entry_relation = heap_open(rt_entry->relid, NoLock);
rt_entry_relation = table_open(rt_entry->relid, NoLock);
/*
* Rewrite the targetlist as needed for the command type.
@ -3616,7 +3616,7 @@ RewriteQuery(Query *parsetree, List *rewrite_events)
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("INSERT with ON CONFLICT clause cannot be used with table that has INSERT or UPDATE rules")));
heap_close(rt_entry_relation, NoLock);
table_close(rt_entry_relation, NoLock);
}
/*