Bug in MERGE's test for tables with rules - Mailing list pgsql-hackers

From Dean Rasheed
Subject Bug in MERGE's test for tables with rules
Date
Msg-id CAEZATCVkBVZABfw71sYvkcPf6tarcOFST5Bc6AOi-LFT9YdccQ@mail.gmail.com
Whole thread Raw
Responses Re: Bug in MERGE's test for tables with rules
List pgsql-hackers
While playing around with rules and MERGE, I noticed that there is a
bug in the way that it detects whether the target table has rules ---
it uses rd_rel->relhasrules, which can be incorrect, since it might be
set for a table that doesn't currently have rules, but did in the
recent past.

So it actually needs to examine rd_rules. Technically, I think that it
would be sufficient to just test whether rd_rules is non-NULL, but I
think it's more robust and readable to check rd_rules->numLocks, as in
the attached patch.

Regards,
Dean

Attachment

pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Another multi-row VALUES bug
Next
From: David Rowley
Date:
Subject: Re: Hash index build performance tweak from sorting