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 1wDolF-003Oir-2g for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Apr 2026 19:21:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wDolE-00AxgB-33 for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Apr 2026 19:21:52 +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.96) (envelope-from ) id 1wDolE-00Axfq-1w for pgsql-hackers@lists.postgresql.org; Fri, 17 Apr 2026 19:21:52 +0000 Received: from meesny.iki.fi ([195.140.195.201]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wDolB-00000001WBL-3mYi for pgsql-hackers@postgresql.org; Fri, 17 Apr 2026 19:21:51 +0000 Received: from [10.0.2.15] (unknown [130.41.208.2]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 4fy4WC3JKdzyQw; Fri, 17 Apr 2026 22:21:43 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1776453704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lXGkzP8jZZHmCxlnxAGNOjwXVGj/RITCc3w+8boOIXk=; b=oG3mt5rHK9sNKe2qNFdUpefyyrlRe0z8JoC64rYvKobY0FhEeyhQWdNnQzyrg4D6ey/INn a08d5L0qZ5u49uNl2dhA+0zEjOdPAB4rL3WhRfYehUXHaaLSA2i/eppS3nXmZ191lCb0v9 K+hlXoHIINdvAdQdP44JDqfaqqMiYOk= ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1776453704; b=gAkz7iulZYDZ3iPILSJ25ZFbtMuG6DpZnf6mmGJ+wvL8OKnSZYChLHlYj4tRlM4RK5zZ42 NlUuJgfCMbO+Z2fkpDlFCneeEz92j8jCq9qFu5LKKcjsXZMV0MTvOTKvwkKoE6os0XdORw 9jyVLsMNkLL3MzMSGpoR8hd1ibwNa9A= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1776453704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lXGkzP8jZZHmCxlnxAGNOjwXVGj/RITCc3w+8boOIXk=; b=cuLIYuvuIrPT6zO6I1o2jeuq3DyKrdoakVcy+lsQey5xP5NPtKVSgHDpQijU36ppPLvc/O tgu7wGypzBAK8JDxnAtbxrW7Pqwc3vW+UYD74ygWNNQP2vPtHqR6B6n2i6zANWbX95vobc z8oSml/o0UZTWtD9+9+7qbmQmbCVVMk= Message-ID: Date: Fri, 17 Apr 2026 22:21:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Reduce build times of pg_trgm GIN indexes To: Tom Lane Cc: Peter Eisentraut , David Geier , Matthias van de Meent , pgsql-hackers References: <5d366878-2007-4d31-861e-19294b7a583b@gmail.com> <9ac3931a-180e-4283-a7a8-05eb66099206@iki.fi> <2e11134f-02c3-43da-8c39-fb520a1a251d@iki.fi> <66620ec7-0f81-4813-9cf1-b901a56efcc3@gmail.com> <2a76b5ef-4b12-4023-93a1-eed6e64968f3@gmail.com> <6439c655-e281-409d-b884-6586750d5820@iki.fi> <342012.1776017102@sss.pgh.pa.us> <8f3fab0e-02e1-4948-9683-224fe54e30ae@iki.fi> <77cc23dd-ac53-4bb9-9e90-0019c9ff58df@gmail.com> <195097d6-64cd-4adb-b8a3-1d86ae31c411@iki.fi> <2197023.1776288324@sss.pgh.pa.us> <4c1f88d7-5102-45b3-94e3-86d7e4b46b0a@eisentraut.org> <99ce20a5-793a-4182-9120-f274fbef9bfd@iki.fi> <2340004.1776350271@sss.pgh.pa.us> <37ce5cce-66ca-4216-ae88-af39c444042d@iki.fi> <2438252.1776361625@sss.pgh.pa.us> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: <2438252.1776361625@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 16/04/2026 20:47, Tom Lane wrote: > Heikki Linnakangas writes: >> On 16/04/2026 17:37, Tom Lane wrote: >>> Not excited about making massive changes for this. > >> Having all three would be a very localized change in postgres.h. > > Sure, but *using* them in a consistent way would be invasive. > >>> I remain far less certain than Peter is that this discussion has >>> anything to do with why Coverity is complaining about >>> ginExtractEntries. I still think we should make some minimum-effort >>> change to see if the complaint goes away before expending a lot of >>> brain cells on choosing a final fix. > >> I think I'm going to commit my proposal to turn PointerGetDatum() back >> into a macro, and see if that makes Coverity happy. Then we'll know, and >> we can decide on the next steps. Any objections? > > WFM. Grepping for PointerGetDatum(), there are a bunch of wrappers of it for specific types, like: static inline Datum CStringGetDatum(const char *X) static inline Datum NumericGetDatum(Numeric X) Most are marked "const". These all potentially have the same problem, but I think for these it is a good assumption that resulting Datum will not be used to modify *X, so we can leave them alone. I guess we didn't do that for NumericGetDatum just because the Numeric typedef doesn't allow that. There's also: static inline Datum fetch_att(const void *T, bool attbyval, int attlen) The "const" seems reasonable on that too. This is an interesting case: static inline Datum EOHPGetRWDatum(const struct ExpandedObjectHeader *eohptr) { return PointerGetDatum(eohptr->eoh_rw_ptr); } That RW stands for read/write, which sounds alarming. But the returned datum points to eohptr->eoh_rw_ptr rather than *eohptr itself, so I think the 'const' is correct here after all. So, pushed a commit that changes just PointerGetDatum() itself, leaving all those others alone. - Heikki