Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1miJPR-0004kk-Qx for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Nov 2021 16:46:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1miJPQ-0002gX-9b for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Nov 2021 16:46:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1miJPQ-0002ek-0p for pgsql-bugs@lists.postgresql.org; Wed, 03 Nov 2021 16:46:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1miJPN-0002tR-CA for pgsql-bugs@lists.postgresql.org; Wed, 03 Nov 2021 16:46:42 +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 1A3Gkcpg134217; Wed, 3 Nov 2021 12:46:38 -0400 From: Tom Lane To: "David G. Johnston" cc: Erki Eessaar , Peter Eisentraut , "pgsql-bugs@lists.postgresql.org" Subject: Re: INFORMATION_SCHEMA.routines column routine_definition does not show the source In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Wed, 03 Nov 2021 08:21:34 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <134215.1635957998.1@sss.pgh.pa.us> Date: Wed, 03 Nov 2021 12:46:38 -0400 Message-ID: <134216.1635957998@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > The information schema query consults pg_proc.prosrc directly instead of > calling pg_get_functiondef(...) (which didn't exist when the original query > was written, and hasn't been wrong until now). pg_get_functiondef would produce more than we want, but it looks like pg_get_function_sqlbody() would do. BTW, while researching this I noted the header comment for pg_get_functiondef: * Note: if you change the output format of this function, be careful not * to break psql's rules (in \ef and \sf) for identifying the start of the * function body. To wit: the function body starts on a line that begins * with "AS ", and no preceding line will look like that. Needless to say, the SQL-function-body patch has ignored this advice totally. At the very least this comment needs to be adjusted, but I wonder if it's not telling us that \ef and/or \sf are broken. regards, tom lane