Fix compatibility with pg12 (commit fdba460a26a)

Also fix a warning for an unused variable with version prior pg10
This commit is contained in:
Julien Rouhaud 2018-10-09 23:24:39 +02:00
parent 0f1e6bd9c5
commit 33ea28b538
2 changed files with 8 additions and 2 deletions

View file

@ -464,8 +464,10 @@ hypo_get_relation_info_hook(PlannerInfo *root,
bool inhparent,
RelOptInfo *rel)
{
bool hypopart = false;
Relation relation;
#if PG_VERSION_NUM >= 100000
bool hypopart = false;
#endif
if (HYPO_ENABLED())
{

View file

@ -419,7 +419,11 @@ transformPartitionSpec(Relation rel, PartitionSpec *partspec, char *strategy)
* rangetable entry. We need a ParseState for transformExpr.
*/
pstate = make_parsestate(NULL);
rte = addRangeTableEntryForRelation(pstate, rel, NULL, false, true);
rte = addRangeTableEntryForRelation(pstate, rel,
#if PG_VERSION_NUM >= 120000
AccessShareLock,
#endif
NULL, false, true);
addRTEtoQuery(pstate, rte, true, true, true);
/* take care of any partition expressions */