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 1v8SUo-000xb1-5f for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Oct 2025 00:02:30 +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 1v8SUk-009CYb-Vc for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Oct 2025 00:02:27 +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 1v8SUk-009CYT-M2 for pgsql-hackers@lists.postgresql.org; Tue, 14 Oct 2025 00:02:27 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v8STk-0021FG-2p for pgsql-hackers@lists.postgresql.org; Tue, 14 Oct 2025 00:02:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=n7uCwG7WG39oaTCp0riDDh5QXf9kgoNt83lMDoHLYTA=; b=Rd4Ze0oG9pMQc3M77HSHokXocK WbZXde8TT7gjbraxUx/MFOmy6r1qB/njqIYEUVCZZ4f9AzgQUBB03/wdOgURuPgZCaQblO+RNoem4 FtoBPRZE1WLA6CcfagWtmBufYAwzs/zP5aYDVZpgCfV7jfOxGS3QYR++ADsd6Rbs07tWa2/H2Tg/h EmW0oAOBz466E7sw3n+6+9QZRUiC0VtLro2W2kcT8zTU/ph1X/ICDf0hfZ0Xlb+Lnge1Vs9p146Vl WTdeFDdmupKWDKwcx51125OFiH1zH7Md4NxTPIdil6nXeduTwfAP0fXECJ8JI04RglgwZ6uUVUyjk 6LZ4RrCA==; Received: from [2409:11:4120:300:1a4a:7fda:dd4c:8b4c] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v8STc-005HhU-23; Tue, 14 Oct 2025 00:01:18 +0000 Date: Tue, 14 Oct 2025 09:01:00 +0900 (JST) Message-Id: <20251014.090100.1456332709714986500.ishii@postgresql.org> To: alvherre@kurilemu.de Cc: li.evan.chao@gmail.com, tgl@sss.pgh.pa.us, pramsey@cleverelephant.ca, ojford@gmail.com, peter@eisentraut.org, krasiyan@gmail.com, vik@postgresfriends.org, andrew@tao11.riddles.org.uk, david@fetter.org, pgsql-hackers@lists.postgresql.org Subject: Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options From: Tatsuo Ishii In-Reply-To: <202510131113.mvosyuj5dbsp@alvherre.pgsql> References: <20251013.143941.1447453701514209859.ishii@postgresql.org> <202510131113.mvosyuj5dbsp@alvherre.pgsql> X-Mailer: Mew version 6.8 on Emacs 29.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:1a4a:7fda:dd4c:8b4c (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > Hmm, this change made me realize that all or almost all the calls to > get_func_name() would crash if it were to return a NULL value. I found > no caller that checks the return value for nullness. I wonder why do we > allow it to return NULL at all ... it might be better to just > elog(ERROR) if the cache entry is not found. I agree it's better but what about user defined functions? Some of them might already check the return value to emit their own error messages, I don't know. If so, modifying get_func_name() could break them. Maybe invent something like get_func_name_with_error(calling elog(ERROR)) and gradually update our code? Best regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp