Incorrect use of errcode_for_file_access in backend code

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Incorrect use of errcode_for_file_access in backend code
Дата
Msg-id 20180902200747.GC1343@paquier.xyz
обсуждение исходный текст
Ответы Re: Incorrect use of errcode_for_file_access in backend code  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hi all,

While looking at another patch for slot.c, I have noticed what looks
like incorrect use of errcode_for_file_access:
- errcode_for_file_access() is used with rmtree(), which makes no sense
as this comes from common/rmtree.c, and a warning already shows up using
%m.
- ERRCODE_DATA_CORRUPTED is not used to mention corrupted data, and
instead errcode_for_file_access() gets called.

Wouldn't something like the attached provide more adapted error
handling?  That's mostly error handling beautification, so I would be
incline to just fix HEAD.

(I have noticed some inconsistent error string format in autoprewarm.c
on the way.)

Thoughts?
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Bug in slot.c and are replication slots ever used at Window?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Stored procedures and out parameters