Re: fix "Success" error messages

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: fix "Success" error messages
Дата
Msg-id 36d38542-63e9-b73c-09fe-bd5e32e06066@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: fix "Success" error messages  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: fix "Success" error messages  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On 2019-06-19 04:51, Michael Paquier wrote:
> On Tue, Jun 18, 2019 at 09:13:19AM -0700, Shawn Debnath wrote:
>>>          case SLRU_WRITE_FAILED:
>>>              ereport(ERROR,
>>>                      (errcode_for_file_access(),
>>>                       errmsg("could not access status of transaction %u", xid),
>>> -                     errdetail("Could not write to file \"%s\" at offset %u: %m.",
>>> -                               path, offset)));
>>> +                     errno == 0
>>> +                     ? errdetail("Short write to file \"%s\" at offset %u.", path, offset)
>>> +                     : errdetail("Could not write to file \"%s\" at offset %u: %m.",
>>> +                                 path, offset)));
> 
> There is no point to call errcode_for_file_access() if we know that
> errno is 0.  Not a big deal, still..  The last time I looked at that,
> the best way I could think of would be to replace slru_errcause with a
> proper error string generated at error time.  Perhaps the partial
> read/write case does not justify this extra facility.  I don't know.
> At least that would be more flexible.

Here is an updated patch set that rearranges this a bit according to
your suggestions, and also fixes some similar issues in pg_checksums.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: "ago" times on buildfarm status page
Следующее
От: Tom Lane
Дата:
Сообщение: Re: assertion at postmaster start