Fix rule-detection code for MERGE.
authorDean Rasheed <dean.a.rasheed@gmail.com>
Fri, 25 Nov 2022 13:31:48 +0000 (13:31 +0000)
committerDean Rasheed <dean.a.rasheed@gmail.com>
Fri, 25 Nov 2022 13:31:48 +0000 (13:31 +0000)
commit7b2ccc5e03bf16d1e1bbabca25298108c839ec52
tree8e3718e4ed33fe7542f18f445d7252a0f2924450
parentb1d0158060f3128331766156798d16b2227fb451
Fix rule-detection code for MERGE.

Use the relation's rd_rules structure to test whether it has rules,
rather than the relhasrules flag, which might be out of date.

Reviewed by Tom Lane.

Backpatch to 15, where MERGE was added.

Discussion: https://postgr.es/m/CAEZATCVkBVZABfw71sYvkcPf6tarcOFST5Bc6AOi-LFT9YdccQ%40mail.gmail.com
src/backend/parser/parse_merge.c