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.96) (envelope-from ) id 1vNZ8B-006f7V-2o for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Nov 2025 16:09:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vNZ8A-001hce-1e for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Nov 2025 16:09:34 +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.96) (envelope-from ) id 1vNZ8A-001hcW-0g for pgsql-hackers@lists.postgresql.org; Mon, 24 Nov 2025 16:09:34 +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.96) (envelope-from ) id 1vNZ88-001FuT-1m for pgsql-hackers@postgresql.org; Mon, 24 Nov 2025 16:09:34 +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 5AOG9Tbk955003; Mon, 24 Nov 2025 11:09:29 -0500 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers Subject: Re: get rid of Pointer type, mostly In-reply-to: <4154950a-47ae-4223-bd01-1235cc50e933@eisentraut.org> References: <4154950a-47ae-4223-bd01-1235cc50e933@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Mon, 24 Nov 2025 11:20:56 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <955001.1764000569.1@sss.pgh.pa.us> Date: Mon, 24 Nov 2025 11:09:29 -0500 Message-ID: <955002.1764000569@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > In a previous thread[0], the question was asked, 'Why do we bother with > a "Pointer" type?'. So I looked into get rid of it. > There are two stages to this. One is changing all code that wants to do > pointer arithmetic to use char * instead of relying on Pointer being > char *. Then we can change Pointer to be void * and remove a bunch of > casts. I'm in favor of that ... > The second is getting rid of uses of Pointer for variables where you > might as well use void * directly. These are actually not that many. ... but not of that. In particular, I think it's just fine if DatumGetPointer and PointerGetDatum take and return Pointer. regards, tom lane