Re: Correct SQLSTATE for ENOMEM in file access

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexander Kuzmenkov <akuzmenkov(at)timescale(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Correct SQLSTATE for ENOMEM in file access
Date: 2024-02-02 19:12:13
Message-ID: 3229197.1706901133@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alexander Kuzmenkov <akuzmenkov(at)timescale(dot)com> 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 small patch to
> fix this.

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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Kuzmenkov 2024-02-02 19:28:39 Re: Correct SQLSTATE for ENOMEM in file access
Previous Message Alena Rybakina 2024-02-02 19:06:17 Re: POC, WIP: OR-clause support for indexes