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 1w5K6L-0038FX-17 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 09:00:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5K6J-00DEym-2X for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 09:00:32 +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 1w5K6J-00DEyd-1a for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 09:00:31 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5K6H-000000012NQ-21VM for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 09:00:31 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-660a58841d4so3134276a12.0 for ; Wed, 25 Mar 2026 02:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774429229; cv=none; d=google.com; s=arc-20240605; b=Ux3ZD9ZQLHZRd4CkQySm5B0j/G6ycnF1oyryVdolZze25Is/VXQFiGeXVQU7H1ZzaG 0iM2JFiI5nAKlfqamgRVCgt5J37IyxpGQ9/ZrZuTmPq+AEh2SFqz6SKSwykBoT/uT2mm 3F9Iwptkralj0M0TNawPueVg2zkui/YkAmqOsUGIffTCBFmCppGCmfR7A++ygAKmLKnb HPTg2f8eFnCskxYAxQv+jVelrtKd4J8FeoheIDwBruKitMPvai+3ebJYcziXPaVgyS7d RA2f36hAt9oXKoUlkeNqakDrD6vsoe9UlyIQSL93Ns+GV3Xfre62WtUZvR34Aml9e/k1 iU8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=39kO6iBJWdorYfYt9Pin60wb2tC03nKNn3kRoXPCJMw=; fh=Wc+q9WCg8mqrwh8v7nNgCdm3A0AmZzC0cAJsPcHjFqc=; b=EJqc8F6oDmyGWmu87BAmBdKL9UCmldhffLANF6pDNYy+uN4eaigMDEGVJDy3DEj4lg dvSDmzSQ3l1nP29uAJRCo7HJAPsUc2GO7HuAdTbi9AwvbnjvmlmO1u/xGXFFm4RvBUzd PIFN6HkWtHiL6sHET2nkOKb7c9kuNHBfSqqWYPRj6mTxtNONgEVtpQmCtkI3FVQ+w5iy gV0hdIdmZ/zKK2Het/QnmyTXbhQ6W4Y/Ihl7YJakExMgT8IAp6EWdFA5kq7dGH10+Pzy VQ2PHLK74J2jQXNl7mcSj363znLG8FyprhoUIEWSN57cYQsNdSI4Ga2RwS5fktSzsfzn /ACQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774429229; x=1775034029; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=39kO6iBJWdorYfYt9Pin60wb2tC03nKNn3kRoXPCJMw=; b=iq8PvcoLA1HS1586fs5puYrE2ocj52YsqRX3xulkjKzTb7VTsnyNx5Jy+Ofmz9/WH3 nQZd7Ijyy1PBdYwnhPPrD4E3bmlp51QFqzZ9URdbDEbAEexa0RwFiAgsFgL6pfbt8Fa4 9AbAcL8lM8N93ES5LGnq/K+LzKvr2E85OiXf5bqaLyoG2m6TtMLbQ1jyKP3fDmMQ8Wzl 4qhZvy7xK0pcZ3qa6ZUhgGGfTBPsGgsREx47ZBcqAhgCUxjiJvzRFYnTWLMIP9jrR04E fM3kLIKOWk1bvwk+gSxfjAtb640MxEPCR7SyzxxEdeBXshyHS5t78C70oduDnaWwc2nV 1tQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774429229; x=1775034029; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=39kO6iBJWdorYfYt9Pin60wb2tC03nKNn3kRoXPCJMw=; b=XTWI47kMRN/c/yZNqYDLwnggN4SFI0tag+RvFIplfYyke1HMERgQZqJKK0FjvvTB70 +1ftd4jFE0pPQU271f0I8gP7Otdyghd7QxItNN9kVYjeqR6vgo1XRbmN7h3YCBROlkKy jGt1CbXOgqsDsSImTTNdC02HCyrQPuWb41FMY1PT6YUQRCKAJRd0dXfm92e/p45PXMtB hrWWSWL0MmVcN5IUzTgMzQYiDgUEh6z5ng4vtqwuWTNfDt6nkK8kNfnH0/TZ+EOI86D6 gcURYtBPcJdK8bH/dmEWGPiVUlT/BbHu0+XPAyOv6Xut2DqqKskmk1w3w4vJjHAUBUQx V18A== X-Gm-Message-State: AOJu0Yy+cBiCaDdxuagVnk16/P1jen+MtIuzGUA63E8nlwZ+IABtEwuw aW/YOAlGd7iVQ4xVuL+KX1Nu3b1lIBdmoD23AAfCx6wvM3jtCTqyzqU24xZAvxVxLvMSlGTu1RB kmblVSe9BHyJrYqpqQJxX0vMTXA9RA2U= X-Gm-Gg: ATEYQzwTTp7TjkBOhQF0drsJTa4LgahE/Q2BpL8y8e+VOFiTTA6Giiwd0BYivqFA7hY xaunFAZdPSmn+LsJvmfUob5UIRDuFH68IFG5klnSdTfEoMh15feNGS+aOGzTOKQuPVWtpesoWe2 n59bpuF4p8Qt3hdZkHSEsY/sqpU4eDfK2v/1Pjg5QarCC+fgsyCebOVUHrocWDP7bUiUZR8WEH7 ysuQzXLmBY4AspP58K+12OPHr4v8M3tDtwuxS6nXGUEliBMDgmsxDmjISgvxrLZduk+/PnCxFRd 3G4tPBip7uyXrSZav6yY0GhdsBNpgc2YvC7v X-Received: by 2002:a17:907:1b05:b0:b94:22b1:4aa9 with SMTP id a640c23a62f3a-b9a553074e4mr179521666b.53.1774429228449; Wed, 25 Mar 2026 02:00:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Tender Wang Date: Wed, 25 Mar 2026 17:00:17 +0800 X-Gm-Features: AQROBzCOIVmqFfy9Rm5Tab3vuTxX2ulwQeohnbcPz0bFRUDOdI7hMxzi87h4lAY Message-ID: Subject: Re: Fix "could not find memoization table entry" To: David Rowley Cc: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley =E4=BA=8E2026=E5=B9=B43=E6=9C=8825=E6= =97=A5=E5=91=A8=E4=B8=89 10:09=E5=86=99=E9=81=93=EF=BC=9A > > On Wed, 25 Mar 2026 at 13:31, David Rowley wrote: > > Obviously, we don't want to back-patch anything that would cause a > > user-visible change in the return value of hash_numeric(), so I've > > been experimenting to see if there's any way to get PostgreSQL to > > output any value from hash_numeric() larger than 2^31 and I've been > > unable to. I tried: > > I was experimenting with a less risky fix by having the datum_image > functions force the sign-extended representation of the Datum before > hashing or comparing. > > Attached is a quick PoC of what that would look like. It does fix the > reported problem. But it is a hack and doesn't fix the root cause of > the issue. > > Despite the hackiness, I feel this might be better than the > whack-a-mole approach of just fixing incorrect usages of the > PG_RETURN_* macros as and when we find them. No objection from me. It seems no users have complained about hash_numberic(), and except for this reported issue, no internal errors have been reported due to hash_numberic(). --=20 Thanks, Tender Wang