Re: Correct SQLSTATE for ENOMEM in file access

2024-02-02 Thread Tom Lane
Alexander Kuzmenkov writes: > On Fri, Feb 2, 2024 at 8:12 PM Tom Lane wrote: >> Hmm, do you think this is actually reachable? AFAIK we should only be >> calling errcode_for_file_access() after functions that are unlikely to >> report ENOMEM. > It's reachable, that's how I noticed. I'm seeing lo

Re: Correct SQLSTATE for ENOMEM in file access

2024-02-02 Thread Alexander Kuzmenkov
On Fri, Feb 2, 2024 at 8:12 PM Tom Lane wrote: > Hmm, do you think this is actually reachable? AFAIK we should only be > calling errcode_for_file_access() after functions that are unlikely to > report ENOMEM. It's reachable, that's how I noticed. I'm seeing logs like "XX000: could not load libra

Re: Correct SQLSTATE for ENOMEM in file access

2024-02-02 Thread Tom Lane
Alexander Kuzmenkov writes: > Looking through the logs of some server that were experiencing out of > memory errors, I noticed that errcode_for_file_access() reports > ERRCODE_INTERNAL_ERROR for ENOMEM, while the correct SQLSTATE for this > should probably be ERRCODE_OUT_OF_MEMORY. Attached is a s

Correct SQLSTATE for ENOMEM in file access

2024-02-02 Thread Alexander Kuzmenkov
Looking through the logs of some server that were experiencing out of memory errors, I noticed that errcode_for_file_access() reports ERRCODE_INTERNAL_ERROR for ENOMEM, while the correct SQLSTATE for this should probably be ERRCODE_OUT_OF_MEMORY. Attached is a small patch to fix this. --- Alexande