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 1w5Tk0-003I45-0Q for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 19:18:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5Tjy-00G8EI-1l for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 19:18:06 +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 1w5Tjy-00G8E9-0t for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 19:18:06 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5Tjw-000000017gj-148W for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 19:18:06 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-7d9b1c57a4cso113990a34.3 for ; Wed, 25 Mar 2026 12:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774466283; x=1775071083; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UjgRq/k0zdVQ/y0RCpZOs+q3gKd2JHQlberegddhoYU=; b=biQ/CNpmPxwMupVGnOM/rmh0j0hhistiddMxjb911DgydK7ZA00r+QQWONZvuuE+tn Rm3AoaHxfV2gpo0aH1UwbWx5BIf65hLT+7vAKwyearXsn9QNdcVQk8Z+9mDNIUolhPbl RXkvCRiPZIIhadsUJMqFvgC4Yby+PGHoA9j5Ojk7CeH43DpOjgpqbhbVIPU32ToM4X7g rfRj46m5sQ+eIa72VSC4b07k2i5RgqOwanTFhTAgKrrcykH1FQSmRp9sWAeIRN6YLHDi wBPyP9DHq/vdgxlUyE+SSRI1fUTU994ry1e7AiRsqtHhO1Bgkrh1Pr7OVhRZIVNTfNZs w94w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774466283; x=1775071083; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UjgRq/k0zdVQ/y0RCpZOs+q3gKd2JHQlberegddhoYU=; b=CdYZIYT2qyMfAgHq5RXI4p+LOW0gvChSFFY69G1vw+XFMDkEXPC3IcQsXG3d0TfSIe RJln9kT3zkrBLfVF6AhDXsr2TWpcEuMF7/WB1sXaeVRKaAUtc2FNuhlpwReEHEsOo9UT Y9vZsyp+zpwfud2N1ln6TJCE/P86VYfy9sTTckhFaAe+KJMNXkHw3ApYiiiCNJ8rhtrz akAOBBzzxRD+4dN/k3xGlcT7q62AKZB8YaTOb8AwM10Wbm25/XZ++i2cmZTOxZ2yjW1K cq+IoIDSNu5DB9V2EI883GvUBcBp3W5x5/6vNG+Kx5V0hxDDIxSk3/A/T1sWDSeagoEI XZvA== X-Forwarded-Encrypted: i=1; AJvYcCWShfHqHFnRirnjN4ao8I5pzkzED+M2FfHIT3N1TrpTKHY0yDKyj4EzAWhre9QpwoMVLulZUstn3DPTRZS0@lists.postgresql.org X-Gm-Message-State: AOJu0YxvPa3n8jFCkMj3MuRydhdUWlSiqbV8FH/bguVMmg3PUzXQQwCr U7RQobpBrlvA0MOPNgGnuhyhmj4W2TDRXDQ5LyWHdAZ11Kujf2gGpwti X-Gm-Gg: ATEYQzwxH9vUwPaG0LFKOi9J8Yzmn3H2aka2iDGunG3ydybZ5VJFkqnM3vTxd4YjilP ZqCsnWrEuE+ARNArDrSmwtIx25lH7G1gjsYwhjy7HxUroePc/mtpkLQ1mv+nm/h1C+//WtPZZus NPp6qpVurIzuH/BAG/Qs8XQxdOlC/DLhhSTxLtQFDxUWHRgNc2dImZfPVF6Z1z18IdzWysAjamy RWUkZgiRHy7esdIRJPz1MqTQhEIIU6ca4di2850i8ImLOU6LDRUxwJagCmjY5A7vEhGIUu8zsSE yPVUOedp37VHjflEVfULpa4xkLsEf+wsM+4KjyEHLQajFmVniOCCkCkjjZ/0Kuq9xAlmYFXMYZG H22An8LPkuD0SVnukWs37MXsvw/FlxLpCpzenzn8DNAEDA7wpyPYG8N6nOS1SXTmyqmobjOBH4Z 4eUaQEhAXxBUhVpRr999Dyg/g3FTTRRTHiJBxwDMBvoV0IcaWKtHcoIIU3h/fnPM4OTofSJ+mQW LTukvgbgyJodFQTU680fw== X-Received: by 2002:a05:6820:1614:b0:67c:2bab:bf5a with SMTP id 006d021491bc7-67dff4f4db0mr2646134eaf.41.1774466283127; Wed, 25 Mar 2026 12:18:03 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-41cc7bb2309sm320634fac.17.2026.03.25.12.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2026 12:18:02 -0700 (PDT) Date: Wed, 25 Mar 2026 14:18:00 -0500 From: Nathan Bossart To: Peter Eisentraut Cc: Jianghua Yang , pgsql-hackers@lists.postgresql.org, jian.universality@gmail.com, amitlangote09@gmail.com Subject: Re: [PATCH] Fix wrong argument to SOFT_ERROR_OCCURRED in timestamptz_date Message-ID: References: <692b9dba-3060-49e3-99c4-136b1f7cc4e9@eisentraut.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <692b9dba-3060-49e3-99c4-136b1f7cc4e9@eisentraut.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Mar 25, 2026 at 07:17:15AM +0100, Peter Eisentraut wrote: > On 24.03.26 21:53, Nathan Bossart wrote: >> LGTM. To prevent this from happening in the future, I think we ought to >> change SOFT_ERROR_OCCURRED to a static inline function. I tried that, and >> I got the following warnings: >> >> execExprInterp.c:4964:27: warning: incompatible pointer types passing 'ErrorSaveContext *' (aka 'struct ErrorSaveContext *') to parameter of type 'Node *' (aka 'struct Node *') [-Wincompatible-pointer-types] >> 4964 | if (SOFT_ERROR_OCCURRED(&jsestate->escontext)) >> | ^~~~~~~~~~~~~~~~~~~~ >> ../../../src/include/nodes/miscnodes.h:54:27: note: passing argument to parameter 'escontext' here >> 54 | SOFT_ERROR_OCCURRED(Node *escontext) >> | ^ >> execExprInterp.c:5200:26: warning: incompatible pointer types passing 'ErrorSaveContext *' (aka 'struct ErrorSaveContext *') to parameter of type 'Node *' (aka 'struct Node *') [-Wincompatible-pointer-types] >> 5200 | if (SOFT_ERROR_OCCURRED(&jsestate->escontext)) >> | ^~~~~~~~~~~~~~~~~~~~ >> ../../../src/include/nodes/miscnodes.h:54:27: note: passing argument to parameter 'escontext' here >> 54 | SOFT_ERROR_OCCURRED(Node *escontext) >> | ^ >> >> I think we just need to add casts to "Node *" for those. AFAICT there >> isn't an actual bug. > > Or maybe we change the escontext field to be of type Node *? I started looking at this, but it seems to be a rather invasive change for the level of gain. Not only does it require more memory management, but we then have to cast it many places like this: ((ErrorSaveContext *) jsestate->escontext)->error_occured = false; If we instead make it an ErrorSaveContext *, we'd still need to cast it to Node * for SOFT_ERROR_OCCURRED, unless we had it accept a void * or something, which defeats the purpose. -- nathan