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 1o08by-0000Fd-Br for pgsql-general@arkaria.postgresql.org; Sat, 11 Jun 2022 21:25:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o08bw-0004Ym-Vk for pgsql-general@arkaria.postgresql.org; Sat, 11 Jun 2022 21:25:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o08bw-0004Ya-LD for pgsql-general@lists.postgresql.org; Sat, 11 Jun 2022 21:25:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o08bp-00062w-LN for pgsql-general@lists.postgresql.org; Sat, 11 Jun 2022 21:25:36 +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 25BLPRiH3109894; Sat, 11 Jun 2022 17:25:27 -0400 From: Tom Lane To: Markur Sens cc: pgsql-general Subject: Re: PG_GETARG_TEXT_PP vs PG_GETARG_TEXT_P In-reply-to: <5C935137-83B0-4E61-BBEB-2D9D2840B8E9@gmail.com> References: <3105047.1654981562@sss.pgh.pa.us> <5C935137-83B0-4E61-BBEB-2D9D2840B8E9@gmail.com> Comments: In-reply-to Markur Sens message dated "Sun, 12 Jun 2022 00:14:33 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3109892.1654982727.1@sss.pgh.pa.us> Date: Sat, 11 Jun 2022 17:25:27 -0400 Message-ID: <3109893.1654982727@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Markur Sens writes: > On 12 Jun 2022, at 12:06 AM, Tom Lane wrote: >> PG_GETARG_TEXT_PP is preferred in new code since it can avoid one >> step of palloc-and-copy-the-value; the only real downside is you >> have to use the appropriate macros to get the string's start address >> and length. > Is it worth adding a relevant comment in the documentation section? It is documented in the source code where these macros are defined (fmgr.h). regards, tom lane