RangeTblEntry.inh vs. RTE_SUBQUERY

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема RangeTblEntry.inh vs. RTE_SUBQUERY
Дата
Msg-id 6c1fbccc-85c8-40d3-b08b-4f47f2093711@eisentraut.org
обсуждение исходный текст
Ответы Re: RangeTblEntry.inh vs. RTE_SUBQUERY  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
Various code comments say that the RangeTblEntry field inh may only be 
set for entries of kind RTE_RELATION.

For example

  *    inh is true for relation references that should be expanded to 
include
  *    inheritance children, if the rel has any.  This *must* be false for
  *    RTEs other than RTE_RELATION entries.

and various comments in other files.

(Confusingly, it is also listed under "Fields valid in all RTEs:", but 
that definitely seems wrong.)

I have been deploying some assertions to see if the claims in the 
RangeTblEntry comments are all correct, and I tripped over something.

The function pull_up_simple_union_all() in prepjointree.c sets ->inh to 
true for RTE_SUBQUERY entries:

     /*
      * Mark the parent as an append relation.
      */
     rte->inh = true;

Whatever this is doing appears to be some undocumented magic.  If I 
remove the line, then regression tests fail with plan differences, so it 
definitely seems to do something.

Is this something we should explain the RangeTblEntry comments?



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Relation bulk write facility
Следующее
От: wenhui qiu
Дата:
Сообщение: Re: Thoughts about NUM_BUFFER_PARTITIONS