Re: Bug: When user-defined AM is used, the index path cannot be selected correctly

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Quan Zongliang <quanzongliang(at)yeah(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug: When user-defined AM is used, the index path cannot be selected correctly
Date: 2022-09-01 21:22:29
Message-ID: 706539.1662067349@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I think we need something more like the attached.

Meh -- serves me right for not doing check-world before sending.
The patch causes some plans to change in the btree_gin and btree_gist
modules; which is good, because that shows that the patch is actually
doing what it's supposed to. The fact that your patch didn't make
the cfbot unhappy implies that it wasn't triggering for those modules.
I think the reason is that you did

+ ((amid) >= FirstNormalObjectId && \
+ OidIsValid(GetDefaultOpClass(BOOLOID, (amid)))) \

so that the FirstNormalObjectId cutoff was applied to the AM's OID,
not to the opfamily OID, causing it to do the wrong thing for
extension opclasses over built-in AMs.

The good news is this means we don't need to worry about making
a test case ...

regards, tom lane

Attachment Content-Type Size
recognize-extension-boolean-opclasses-3.patch text/x-diff 4.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2022-09-01 21:26:22 Re: windows resource files, bugs and what do we actually want
Previous Message Andres Freund 2022-09-01 21:22:05 Re: windows resource files, bugs and what do we actually want