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 1w4qHq-002brJ-1g for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 01:10:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w4qHp-003NE6-0B for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 01:10:25 +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 1w4qHo-003NDx-2W for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 01:10:25 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w4qHm-00000000nBV-2ISf for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 01:10:24 +0000 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-b8f97c626aaso764892366b.2 for ; Mon, 23 Mar 2026 18:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774314621; cv=none; d=google.com; s=arc-20240605; b=OQP2YPQ/drbgeeWf9mr0Cylffi8JuoTia44sgRpFcu4A8R7P8t1MbGK5xqzqsoMxrN Ld5ze4xFy5gE6pNvaHw5t7gm7DYHiK/RPj0XSGMzAbEhnm4GgKNDtBPkQxeDA/FGjcyh CahfIb8XIbJo6eyTA83zSphXOuTIQa/BhdHS0x5sXUv7oSuQSoGLbaCnrWbt284aRHoE sw/SRHy8RR5J4dqDVz54hvtdkFtNbxUZ+OWE++2YWdNJ24N/pRe7IM+kHsmVg8HeZqxu BRQxge3WHV/peEqgANKLbt9vK04TIT38fB8chpoa6pBkngm33bRtFJjefRwy1iQwaak0 C1TQ== 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=uQ9V2Y9FfoRBkPcyU5arEWTZcUq81HxiNwzgtlDS43g=; fh=Wc+q9WCg8mqrwh8v7nNgCdm3A0AmZzC0cAJsPcHjFqc=; b=JwaE4gTkMoAuHzecFI+YOgL7q1aE2S5LTTJH8jJwL7fclI++3LNvN+Onv5eGGBDoUp pKXYTa2hLyVctJaEdY2pud/b8veyoqtuGFdFA5P+Ubpz/q5GPKzL63DAiNGUkb7RBGY3 oqLZBRVgWsNaZ/Sj2cQRP9n8dQZ840L65eXctwjMa23NJNJW5bvRLwqvYy9c8j0WMZvz oSkMumIezdc9O7ZVUh6PIP98S5npNMSUZNj+aYpk2LZWuD/F23riUZQadoBxPBh2i6ch 94IAzqdJd6fCNcm19LV3X0S98FCggGCJrPucGKC2UQ29vP6f72R8zcamkn5O7o6b47Fp H6Jw==; 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=1774314621; x=1774919421; 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=uQ9V2Y9FfoRBkPcyU5arEWTZcUq81HxiNwzgtlDS43g=; b=ErQ2CD71Yh3+05q8/d6crMxLMZ/QGPvl4kAWyYw2ox8Ay8af15naDZi0vqup++xUfK YptMdPGAWsdWca5GqH2+sRq5Xe8+AmUNZ+JRtmJnPITQgodODwdMkCD47wKU8+8k2Wu+ 3OjqN5MgttE9kKu8tXkrZ7UYhAmtwoqAHYlDpW0kVj/vAtH5SN41ALyGDMday1vyISuE KY7dpewcWh+7az1IrhiVuPJt6W+XJdJAM/p7jqzZyc0vuXrj/eqzZF0XiG8YTCNFd6rQ 0dVE0+8g2RzOF0FZyP4d16V4aDzpSRCO5Xzaswt/6JTFcXC4lXHUhhJGszQyoUhg53fs c/6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774314621; x=1774919421; 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=uQ9V2Y9FfoRBkPcyU5arEWTZcUq81HxiNwzgtlDS43g=; b=MnrLVhY6yjBVI3kZZnpbtKVOpKEfGDVXVoPEoexxh04aTw8Y2CLX+ysSmf1cA5a+zm Ag+a12O2cFCPnE/yqMp1BNbTNCcjOw9tP4qxSsi8snRWNPSbEoYg+4P8f3QOFBBjwYjs L4IQAObIsSd0L/FqPHTqroYEAuggVfHbrhrfvOw+I4jERS9eICprAjAlWnCFoe1CXrhx JU7iuzuRMBJgZRHPHWyIPPvB57oI4fOZIt9Peuesu+XngPEfqfkpTmFq8hrsTLhRrRvW l7iDsYqsQiQ+B2nCJw1Q7/LBPZiZWB1+q/TTq6F0yAdy32exryrBiLdLdVJhX/81n3Mg Gz6g== X-Gm-Message-State: AOJu0YyPoLF/AlBIA2+Up8eCAhVRZ/GgLaNpsa/d7zgOF2TMCFeVjmxq CXOeaSgPxOqYJeGUaBdHajGUrB/fGWbTrzVbot9jrUZQeHMiO4l7/Fe5TbVHrxuM4zHHCtW3R3S AjnHj15E/sfhf8MFLrpQ8vxaUmxAVhwk3GmfgClWxoA== X-Gm-Gg: ATEYQzxAmYXBEttjvMfNQcwnAD0AuzQdBAUxMOh6YfRtlUUBQ1nik3ssNO4bJZmmrvG G2WIRT4kdbcN278pE+WH5RankuLWQtaK8kTWSq5lp9uYjxIJ3Wp9lvQ5akQEBOhkWjKfuzga162 FSe6pr/n839Mru/nC9qUUvXX1Js1tVnW3wZQjHzNMW2SDklNk/ObC9qzRAadEuq1z+E2Ju29/uF NWwFEfY52sUhFFqKP51DxqWHfkeinD8ytgOFzDsdXwdsKlhIq4GCcg1I+Cnc5yCAupcNnnswNSr atEmkAg5 X-Received: by 2002:a17:906:3713:b0:b97:3376:7ce with SMTP id a640c23a62f3a-b982f36d6e3mr937884466b.26.1774314620767; Mon, 23 Mar 2026 18:10:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Tender Wang Date: Tue, 24 Mar 2026 09:10:07 +0800 X-Gm-Features: AQROBzC9jnlugjYwJOMiSJzSrYbHUL58p_heZbtmB0qHJ33j2S1uMxnmoIy3N8k 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=8824=E6= =97=A5=E5=91=A8=E4=BA=8C 08:12=E5=86=99=E9=81=93=EF=BC=9A > > On Mon, 23 Mar 2026 at 19:30, Tender Wang wrote: > > Recently, I encountered an error: could not find memoization table > > > The hkeys returned by datum_image_hash() are different, so we can't > > find the entry in the hash table. > > > > In the datum_image_hash(), if typByVal is true, calling > > result =3D hash_bytes((unsigned char *) &value, sizeof(Datum)); > > > > I think we should use typLen here, not sizeof(Datum). > > I tried this way and didn't encounter any errors again. > > The Datum values should be the same. You can't just compare the lowest > attlen bytes of a Datum. Thanks for pointing this out. Actually, I haven't quite figured out why `typLen` cannot be used here. > > It looks to me like the bug is in hash_numeric(). Seems like it has no > idea what type it's meant to return. hash_numeric_extended() doesn't > seem to be much better. > > Do you still get the ERROR after patching with the attached? No error anymore with your patch. --=20 Thanks, Tender Wang