Fix rule-detection code for MERGE.

Dean Rasheed <dean.a.rasheed@gmail.com>

Commit: 7b2ccc5e03bf16d1e1bbabca25298108c839ec52
Author: Dean Rasheed <dean.a.rasheed@gmail.com>
Date: 2022-11-25T13:31:48Z
Releases: 16.0
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

Files

PathChange+/−
src/backend/parser/parse_merge.c modified +2 −1

Discussion