git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d212957)
Translate ENOMEM to ERRCODE_OUT_OF_MEMORY in errcode_for_file_access().
Fri, 2 Feb 2024 20:34:29 +0000 (15:34 -0500)
Fri, 2 Feb 2024 20:34:29 +0000 (15:34 -0500)
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


diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 2c7a20e3d3192e6c822e2e0df426681f6886b679..700fbde6db4185489570e3c18e0deb7ed362916b 100644 (file)
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -922,6 +922,10 @@ errcode_for_file_access(void)
edata->sqlerrcode = ERRCODE_DISK_FULL;
break;
+ case ENOMEM: /* Out of memory */
+ edata->sqlerrcode = ERRCODE_OUT_OF_MEMORY;
+ break;
+
case ENFILE: /* File table overflow */
case EMFILE: /* Too many open files */
edata->sqlerrcode = ERRCODE_INSUFFICIENT_RESOURCES;
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /