Re: best place for "rtree" strategy numbers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: best place for "rtree" strategy numbers
Date: 2015-05-14 23:42:29
Message-ID: 22970.1431646949@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> In Emre Hasegeli's patch for range/inet/geometry opclasses for BRIN, he
> chose to move strategy numbers from gist.h to a more central place. He
> chose skey.h because that's where btree strategy numbers are defined,
> but I'm not sure I agree with that choice.

Yeah, putting those in skey.h was probably not such a great idea.
(IIRC, they didn't use to be there ... it's probably my fault that
they're there now.)

> Therefore I would like to move those numbers elsewhere. Maybe we could
> have a new file which would be used only for strategy numbers, such as
> src/include/access/stratnum.h, and we would have something like this,
> and redefine the ones elsewhere to reference those.

+1

> I can, of course, just leave these files well enough alone and just rely
> on the numbers not changing (which surely they won't anyway) and
> remaining consistent with numbers used in new opclasses (which surely
> they will lest they be born inconsistent with existing ones).

Yeah, we do have checks in opr_sanity which will complain if inconsistent
strategy numbers are used for similarly-named operators. That's a pretty
weak test though, and operator names aren't exactly the right thing to
check anyway. I'd be good with pushing all of that stuff to a new central
header.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kouhei Kaigai 2015-05-14 23:43:59 Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Previous Message Heikki Linnakangas 2015-05-14 23:30:05 Re: KNN-GiST with recheck