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 1tP20N-009mcW-QZ for pgsql-interfaces@arkaria.postgresql.org; Sat, 21 Dec 2024 16:07:04 +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 1tP20M-00A50E-Nk for pgsql-interfaces@arkaria.postgresql.org; Sat, 21 Dec 2024 16:07:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tP20M-00A505-GG for pgsql-interfaces@lists.postgresql.org; Sat, 21 Dec 2024 16:07:02 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tP20J-000hVY-LU for pgsql-interfaces@postgresql.org; Sat, 21 Dec 2024 16:07:01 +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 4BLG6wmw860903; Sat, 21 Dec 2024 11:06:58 -0500 From: Tom Lane To: Jeroen Vermeulen cc: pgsql-interfaces@postgresql.org Subject: Re: libpq: make PGresult* "const" in PQcmdStatus()/PQcmdTuples()? In-reply-to: <859822.1734796591@sss.pgh.pa.us> References: <859822.1734796591@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sat, 21 Dec 2024 10:56:31 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <860901.1734797218.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 21 Dec 2024 11:06:58 -0500 Message-ID: <860902.1734797218@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Both of those return pointers to res->cmdStatus, so it would not make > any sense to const-ify the argument unless you also const-ify the > result; which would cause compiler warnings for users. I'm pretty > sure we've explicitly rejected making this change for that reason. [ digs in archives... ] See previous discussions here: https://www.postgresql.org/message-id/flat/NCBBLFLGLEIDHCJLONHNKEDGFJAA.md= klatt%40ou.edu and here: https://www.postgresql.org/message-id/flat/E1RaRtZ-0008aS-MK%40hans3 regards, tom lane