diff options
Diffstat (limited to 'src/backend/parser/parse_relation.c')
| -rw-r--r-- | src/backend/parser/parse_relation.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index d544a69fc80..dd64f45478a 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -964,7 +964,7 @@ searchRangeTableForCol(ParseState *pstate, const char *alias, const char *colnam int location) { ParseState *orig_pstate = pstate; - FuzzyAttrMatchState *fuzzystate = palloc(sizeof(FuzzyAttrMatchState)); + FuzzyAttrMatchState *fuzzystate = palloc_object(FuzzyAttrMatchState); fuzzystate->distance = MAX_FUZZY_DISTANCE + 1; fuzzystate->rfirst = NULL; @@ -1336,7 +1336,7 @@ buildNSItemFromTupleDesc(RangeTblEntry *rte, Index rtindex, } /* ... and build the nsitem */ - nsitem = (ParseNamespaceItem *) palloc(sizeof(ParseNamespaceItem)); + nsitem = palloc_object(ParseNamespaceItem); nsitem->p_names = rte->eref; nsitem->p_rte = rte; nsitem->p_rtindex = rtindex; @@ -1400,7 +1400,7 @@ buildNSItemFromLists(RangeTblEntry *rte, Index rtindex, } /* ... and build the nsitem */ - nsitem = (ParseNamespaceItem *) palloc(sizeof(ParseNamespaceItem)); + nsitem = palloc_object(ParseNamespaceItem); nsitem->p_names = rte->eref; nsitem->p_rte = rte; nsitem->p_rtindex = rtindex; @@ -1791,7 +1791,7 @@ addRangeTableEntryForFunction(ParseState *pstate, rte->eref = eref; /* Process each function ... */ - functupdescs = (TupleDesc *) palloc(nfuncs * sizeof(TupleDesc)); + functupdescs = palloc_array(TupleDesc, nfuncs); totalatts = 0; funcno = 0; @@ -2302,7 +2302,7 @@ addRangeTableEntryForJoin(ParseState *pstate, * Build a ParseNamespaceItem, but don't add it to the pstate's namespace * list --- caller must do that if appropriate. */ - nsitem = (ParseNamespaceItem *) palloc(sizeof(ParseNamespaceItem)); + nsitem = palloc_object(ParseNamespaceItem); nsitem->p_names = rte->eref; nsitem->p_rte = rte; nsitem->p_perminfo = NULL; |
