Re: [PATCH] Check more invariants during syscache initialization

Поиск
Список
Период
Сортировка
От Dagfinn Ilmari Mannsåker
Тема Re: [PATCH] Check more invariants during syscache initialization
Дата
Msg-id 87v8e6px08.fsf@wibble.ilmari.org
обсуждение исходный текст
Ответ на [PATCH] Check more invariants during syscache initialization  (Aleksander Alekseev <aleksander@timescale.com>)
Ответы Re: [PATCH] Check more invariants during syscache initialization  (Aleksander Alekseev <aleksander@timescale.com>)
Re: [PATCH] Check more invariants during syscache initialization  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Aleksander Alekseev <aleksander@timescale.com> writes:

> Hi Zhang,
>
>> That remind me to have a look other codes, and a grep search `oid != 0` show there are several files using old !=
0.
>>
>> ```
>> .//src/bin/pg_resetwal/pg_resetwal.c: if (set_oid != 0)
>> .//src/bin/pg_resetwal/pg_resetwal.c: if (set_oid != 0)
>> .//src/bin/pg_dump/pg_backup_tar.c: if (oid != 0)
>> .//src/bin/pg_dump/pg_backup_custom.c: while (oid != 0)
>> .//src/bin/pg_dump/pg_backup_custom.c: while (oid != 0)
>> ```
>> That is another story…I would like provide a patch if it worths.
>
> Good catch. Please do so.

Shouldn't these be calling `OidIsValid(…)`, not comparing directly to
`InvalidOid`?

~/src/postgresql (master $)$ git grep '[Oo]id [!=]= 0' | wc -l
18
~/src/postgresql (master $)$ git grep '[!=]= InvalidOid' | wc -l
296
~/src/postgresql (master $)$ git grep 'OidIsValid' |
wc -l
1462

- ilmari



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

Предыдущее
От: 油屋
Дата:
Сообщение: Re: Question about use_physical_tlist() which is applied on Scan path
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: logical decoding and replication of sequences, take 2