Identify views in pg15.13

Relevant PG commit:
https://github.com/postgres/postgres/commit/317aba70e

Previously, when views were converted to RTE_SUBQUERY the relid
would be cleared in PG15. In this patch of PG15, relid is retained.
Therefore we add a check with the "relkind and rtekind" to
identify the converted views.
pull/7986/head
naisila 2025-05-20 16:31:23 +02:00
parent 209d426302
commit 45304190fa
1 changed files with 2 additions and 1 deletions

View File

@ -2246,7 +2246,8 @@ SelectsFromDistributedTable(List *rangeTableList, Query *query)
} }
if (rangeTableEntry->relkind == RELKIND_VIEW || if (rangeTableEntry->relkind == RELKIND_VIEW ||
rangeTableEntry->relkind == RELKIND_MATVIEW) rangeTableEntry->relkind == RELKIND_MATVIEW ||
(rangeTableEntry->rtekind == RTE_SUBQUERY && rangeTableEntry->relkind == 0))
{ {
/* /*
* Skip over views, which would error out in GetCitusTableCacheEntry. * Skip over views, which would error out in GetCitusTableCacheEntry.