Re: [PATCH] amroutine->amsupport from numeric to defined constants

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Nikolay Shaplov <n(dot)shaplov(at)postgrespro(dot)ru>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] amroutine->amsupport from numeric to defined constants
Date: 2016-04-28 12:10:58
Message-ID: CAB7nPqQ_00oQQBfrLpe7c4u=5vR8OFpU61pRGLxy+_RZT5tFnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 26, 2016 at 10:17 PM, Nikolay Shaplov
<n(dot)shaplov(at)postgrespro(dot)ru> wrote:
> While working with postgres code, I found that for gist index number of
> amsupport procs are defined two times. First in src/include/access/gist.h
>
> #define GISTNProcs 9
>
> and second in src/backend/access/gist/gist.c
>
> amroutine->amsupport = 9;
>
> I think this number should be specified only once, in .h file.

Yep, that sounds true.

> So I would offer a patch for all access methods. That changes amsupport and
> amstrategies from numbers to defined constants. (I've added two of them where
> they were missing)

It may be a good idea to make something similar for contrib/bloom if >
0 values are defined for amstrategies or amsupport for consistency.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2016-04-28 13:06:31 Unused macros in contrib code
Previous Message Etsuro Fujita 2016-04-28 11:59:49 Re: Use %u to print user mapping's umid and userid