/*
* Add an entry for a relation to the pstate's range table (p_rtable).
*
- * If pstate is NULL, we just build an RTE and return it without adding it
- * to an rtable list.
- *
* Note: formerly this checked for refname conflicts, but that's wrong.
* Caller is responsible for checking for conflicts in the appropriate scope.
*/
LOCKMODE lockmode;
Relation rel;
+ Assert(pstate != NULL);
+
rte->rtekind = RTE_RELATION;
rte->alias = alias;
* Add completed RTE to pstate's range table list, but not to join list
* nor namespace --- caller must do that if appropriate.
*/
- if (pstate != NULL)
- pstate->p_rtable = lappend(pstate->p_rtable, rte);
+ pstate->p_rtable = lappend(pstate->p_rtable, rte);
return rte;
}