Re: Views no longer in rangeTabls?

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: Views no longer in rangeTabls?
Дата
Msg-id CA+HiwqFC0xDCCiXbUjb-xisxo9PPuA8_ykn8Fz+6RbBJBE8mVA@mail.gmail.com
обсуждение исходный текст
Ответ на Views no longer in rangeTabls?  (David Steele <david@pgmasters.net>)
Ответы Re: Views no longer in rangeTabls?
Список pgsql-hackers
Hi David,

On Fri, Jun 9, 2023 at 17:28 David Steele <david@pgmasters.net> wrote:
Hackers,

While updating pgAudit for PG16 I found the following (from our
perspective) regression.

In prior versions of Postgres, views were listed in rangeTabls when
ExecutorCheckPerms_hook() was called but in PG16 the views are no longer
in this list.

I’m not exactly sure how pgAudit’s code is searching for view relations in the range table, but if the code involves filtering on rtekind == RTE_RELATION, then yes, such code won’t find views anymore. That’s because the rewriter no longer adds extraneous RTE_RELATION RTEs for views into the range table. Views are still there, it’s just that their RTEs are of kind RTE_SUBQUERY, but they do contain some RELATION fields like relid, rellockmode, etc.  So an extension hook’s relation RTE filtering code should also consider relid, not just rtekind.

I’m away from a computer atm, so I am not able to easily copy-paste an example of that from the core code, but maybe you can search for code sites that need to filter out relation RTEs from the range table.

Perhaps, we are missing a comment near the hook definition mentioning this detail about views.
--
Thanks, Amit Langote
EDB: http://www.enterprisedb.com

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

Предыдущее
От: "Joel Jacobson"
Дата:
Сообщение: Re: Do we want a hashset type?
Следующее
От: jian he
Дата:
Сообщение: Re: Do we want a hashset type?