Re: [PATCH] Do not use StdRdOptions in Access Methods

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Nikolay Shaplov <dhyan(at)nataraj(dot)su>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Amit Langote <amitlangote09(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Dent John <denty(at)qqdd(dot)eu>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "Iwata, Aya" <iwata(dot)aya(at)jp(dot)fujitsu(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Subject: Re: [PATCH] Do not use StdRdOptions in Access Methods
Date: 2019-11-15 01:34:49
Message-ID: 20191115013449.GA1849@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 14, 2019 at 11:20:25AM +0300, Nikolay Shaplov wrote:
> For me there is no mush sense in it, as it does not prevent us from wrong type
> casting. Indexes can use all kinds of structures for reloptions, and checking
> that this is index, will not do much.

It seems to me that if the plan is to have one option structure for
each index AM, which has actually the advantage to reduce the bloat of
each relcache entry currently relying on StdRdOptions, then we could
have those extra assertion checks in the same patch, because the new
macros are introduced.

> Do you know way how to distinguish one index from another? If we can check in
> assertion this is index, and this index is spgist, then assertion will make
> sense for 100%. I just have no idea how to do it. As far as I can see it is
> not possible now.

There is rd_rel->relam. You can for example refer to pgstatindex.c
which has AM-related checks to make sure that the correct index AM is
being used.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-11-15 01:49:41 Re: could not stat promote trigger file leads to shutdown
Previous Message Michael Paquier 2019-11-15 01:19:20 Re: SKIP_LOCKED test causes random buildfarm failures