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 1rMtBE-007Ri4-1M for pgsql-general@arkaria.postgresql.org; Mon, 08 Jan 2024 17:12:52 +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 1rMtBB-006VoU-Ps for pgsql-general@arkaria.postgresql.org; Mon, 08 Jan 2024 17:12:49 +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 1rMtBB-006VoL-F9 for pgsql-general@lists.postgresql.org; Mon, 08 Jan 2024 17:12:49 +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 1rMtB9-000VWV-7S for pgsql-general@lists.postgresql.org; Mon, 08 Jan 2024 17:12:48 +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 408HCgQU1944452; Mon, 8 Jan 2024 12:12:42 -0500 From: Tom Lane To: Adrian Klaver cc: David Gauthier , pgsql-general@lists.postgresql.org Subject: Re: How to \ef a function ? In-reply-to: <1940933.1704732479@sss.pgh.pa.us> References: <5991da49-11ba-4b0a-8ed8-a7bc59ea0405@aklaver.com> <1940933.1704732479@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 08 Jan 2024 11:47:59 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1944450.1704733962.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 08 Jan 2024 12:12:42 -0500 Message-ID: <1944451.1704733962@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Yeah, that's what psql is expecting, but it does seem a bit > unforgiving considering that you can write a noise semicolon > in many other backslash commands. And this: > dvdb=# \ef opid.bef_ins_axi_reqs_set_trig(); > ERROR:  expected a right parenthesis > seems outright buggy. I've not looked at the code though. Ah, I see it. The difference in the error messages is because \ef feeds the whole argument to regprocin to find out the function OID if there are no parens, but regprocedurein if there are parens. Neither of those functions like the trailing semicolon, but their complaints are different. More interestingly, \ef is actually trying to ignore trailing semicolons: exec_command_ef_ev tells psql_scan_slash_option to do so. But it's using OT_WHOLE_LINE mode and that function ignores the request in that mode. So that seems like an oversight. regards, tom lane