Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rW01K-002glo-Me for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Feb 2024 20:20:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rW01J-00FgSo-FA for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Feb 2024 20:20:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rW01J-00FgSg-5r for pgsql-hackers@lists.postgresql.org; Fri, 02 Feb 2024 20:20:17 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rW01G-0058oN-Jy for pgsql-hackers@postgresql.org; Fri, 02 Feb 2024 20:20:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 412KKDr63236955; Fri, 2 Feb 2024 15:20:13 -0500 From: Tom Lane To: Alexander Kuzmenkov cc: pgsql-hackers@postgresql.org Subject: Re: Correct SQLSTATE for ENOMEM in file access In-reply-to: References: <3229197.1706901133@sss.pgh.pa.us> Comments: In-reply-to Alexander Kuzmenkov message dated "Fri, 02 Feb 2024 20:28:39 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <3236953.1706905213.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Fri, 02 Feb 2024 15:20:13 -0500 Message-ID: <3236954.1706905213@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 logs like "XX000: > could not load library \"/usr/lib/postgresql/15/lib/plpgsql.so\": out > of memory" from internal_load_library and so on. Not sure what is the > exact configuration required to reproduce this, probably at least the > overcommit should be disabled. OK, can't argue with experimental evidence ;-) regards, tom lane