Skip to content

Commit a153781

Browse files
committed
Translate ENOMEM to ERRCODE_OUT_OF_MEMORY in errcode_for_file_access().
Previously you got ERRCODE_INTERNAL_ERROR, which seems inappropriate, especially given that we're trying to avoid emitting that in reachable cases. Alexander Kuzmenkov Discussion: https://postgr.es/m/CALzhyqzgQph0BY8-hFRRGdHhF8CoqmmDHW9S=hMZ-HMzLxRqDQ@mail.gmail.com
1 parent 87dcc5e commit a153781

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/utils/error/elog.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,10 @@ errcode_for_file_access(void)
920920
edata->sqlerrcode = ERRCODE_DISK_FULL;
921921
break;
922922

923+
case ENOMEM: /* Out of memory */
924+
edata->sqlerrcode = ERRCODE_OUT_OF_MEMORY;
925+
break;
926+
923927
case ENFILE: /* File table overflow */
924928
case EMFILE: /* Too many open files */
925929
edata->sqlerrcode = ERRCODE_INSUFFICIENT_RESOURCES;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy