Re: BUG #18246: pgstathashindex() attempts to read invalid file for hash index attached to partitioned table

Поиск
Список
Период
Сортировка
От Alexander Lakhin
Тема Re: BUG #18246: pgstathashindex() attempts to read invalid file for hash index attached to partitioned table
Дата
Msg-id 876b6e52-f068-648a-3f0e-7eaabd57cf77@gmail.com
обсуждение исходный текст
Ответ на Re: BUG #18246: pgstathashindex() attempts to read invalid file for hash index attached to partitioned table  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: BUG #18246: pgstathashindex() attempts to read invalid file for hash index attached to partitioned table  (Alexander Lakhin <exclusion@gmail.com>)
Список pgsql-bugs
Hello Michael,

13.12.2023 17:18, Michael Paquier wrote:
> On Wed, Dec 13, 2023 at 09:00:01AM +0000, PG Bug reporting form wrote:
>> This anomaly can be observed since 8b08f7d48 from 2018-01-19, but IMO the
>> culprit is e759854a0 from 2017-02-03, which introduced the following
>> asymmetry in pgstatindex.c:
>> if (!IS_INDEX(rel) || !IS_BTREE(rel))
>> if (!IS_INDEX(rel) || !IS_GIN(rel))
>> But:
>> if (!IS_HASH(rel))
> Fun, let's fix that.  Would you like to write a patch?

Yes, please look at the attached,
I've decided to change also index_open() -> relation_open() because
index_open() only adds a check, that is not suitable for this concrete
case, so there is no much sense to use the different function.
(In fact, that check was good enough at the time of e759854a0, but
8b08f7d48 changed it.)
As a result, error messages for hash indexes are becoming consistent with
other indexes. Also I've added a test case for the issue, but maybe it's
superfluous...

Best regards,
Alexander
Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #18246: pgstathashindex() attempts to read invalid file for hash index attached to partitioned table
Следующее
От: 高升
Дата:
Сообщение: about psql copy ,we would like to seek help,Thanks.