Re: [PATCH] Do not use StdRdOptions in Access Methods
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Nikolay Shaplov <dhyan@nataraj.su>
Cc: pgsql-hackers@lists.postgresql.org, Amit Langote <amitlangote09@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Dent John <denty@qqdd.eu>, Thomas Munro <thomas.munro@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, "Iwata, Aya" <iwata.aya@jp.fujitsu.com>, Dmitry Dolgov <9erthalion6@gmail.com>
Date: 2019-11-15T01:34:49Z
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
Commits
-
Refactor reloption handling for index AMs in-core
- 4cb658af7002 13.0 landed
-
Cleanup code in reloptions.h regarding reloption handling
- 50d22de9325f 13.0 landed
-
Refactor code building relation options
- 3534fa223328 13.0 landed
-
Add some assertions to view reloption macros
- 396773762425 13.0 cited