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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] Do not use StdRdOptions in Access Methods
Дата
Msg-id 20191115013449.GA1849@paquier.xyz
обсуждение исходный текст
Ответ на Re: [PATCH] Do not use StdRdOptions in Access Methods  (Nikolay Shaplov <dhyan@nataraj.su>)
Ответы Re: [PATCH] Do not use StdRdOptions in Access Methods  (Michael Paquier <michael@paquier.xyz>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: SKIP_LOCKED test causes random buildfarm failures
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: could not stat promote trigger file leads to shutdown