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 1vWwnz-00Dhlc-2L for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Dec 2025 13:15:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vWwnx-00AU7r-0A for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Dec 2025 13:15:29 +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 1vWwnw-00AU7j-2G for pgsql-hackers@lists.postgresql.org; Sat, 20 Dec 2025 13:15:29 +0000 Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vWwnu-001lVm-1V for pgsql-hackers@lists.postgresql.org; Sat, 20 Dec 2025 13:15:28 +0000 Received: by mail-vs1-xe2d.google.com with SMTP id ada2fe7eead31-5dfd2148bf3so829948137.1 for ; Sat, 20 Dec 2025 05:15:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766236524; x=1766841324; 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=FLeLHY++SI1ljolOL12XlbY/UK4dxdak9HU7fnlzs24=; b=E21H4YbOJ8HC7B2TDkKZi4urqGFbVGS3VzslE4Fxud53F2CGk8+j04WS4Q975MuCTU fZxAHAfMFNRfZttictPqbcdGAzm7PzD0SvMB2duoSr57RxfMvwYscH9mfGXvGRkl7/4W SkMi2Ea5b3Jgwia8ercy1uF8HQEilJxKM/xQR51Euht5rah18c0b5Q+et4uXPyubkRzM lmkMqEQ2tJC7MSG7tojCg3EtlbWSt10KANhaGwd7t0mpLZuZNNO4Y9XDuo/G3wkXs7r1 37t+z0kENZDRGdbjopvASF7vRrkvVM4VOFzm0MBLInIdbzxuoqw4al3+Fbod4ow990f7 zToQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766236524; x=1766841324; 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=FLeLHY++SI1ljolOL12XlbY/UK4dxdak9HU7fnlzs24=; b=tQIawpFQgkKGcCN4nenkila+8FoZ7vUY57HsjBu+bIEXTTvq8KrWbsA5x3o+1z/IoD ZoptF0mmJh1199evvJbFxjWJ4VL9EdduztOTOcL05STobF5K7bVgi2xK4cT5jwaAYwoa 1JExhIYwbnH9Pl2u+ptr79GmMJNIYuj4YhV9CkaIVzq9ckMepqX/74Rk3OjajMA5kBeY KwSo+hLoxa2GK4oJhIFxHiDP1XGw3rB37evzjuizfqROOVsUmQAeLUaziV6lGsYqeh1e ZA36AibbPbGb0yCXdiwsh8EDd/OOa4dqE7ZuF6qEkhB7S4qDxHJv2vhjkzlPr/KQX+Jr BN/Q== X-Gm-Message-State: AOJu0YyK/5VRqHxaPOcgAe5MyxstqlyPPa05CnZAp58xQ7La2/4RQJFq tXfo0uhNybY3Oc6EUZWTyVKHxScYz83fw27QlysYaEpLLvUqeUvolLZ1vrzJFK6fJio8nt0fcqi u4xHyNPpadawAK3gXj/QDbZ45eDenq7Q= X-Gm-Gg: AY/fxX5ViTBhb+6NetFT1By3XxpGruqqjfpB4uvtHn+GMZdyz9YpJwfocjq/cEnQyd4 EElm2rzlyU0Py3sBqOXNC0yRf9Cy/W1LtK2vLV85NXM+ieFIxaoEGb/ek7RTmKCLys4K5SYOnSV x65Qb7LLkzLI+qextMuuksR5it2ahC78QcrvbhHq6/RzwKZc9gHa3nVegdNaqboeYayQaqoNPRm /luLVtHooEQLk/hs29CFk2WhG2hURc62AwcjOAd1vM18jdFWtgjVFkfG8dn77cOsfeJ9Ju7HJzk EGx/3tPH/la9IclfzPJlKsNDFm1onHbbDpOb5qSfYbIy3wXKtlzM8foir3iuP8FvzjAw1NqRt9n AkidoI9ZbP++4Nk8I7JATQz247e+Y16Wtj/coFAGJ8aln7LLhjlq2hYoKuA== X-Google-Smtp-Source: AGHT+IFlgYDxpotPWtrm6dcZdY31c3Mk7M9ratq8PxHrd1c2qYhL6CTXuM0k5/98SOCC4DABOrVCvDgUtThus9fdPKs= X-Received: by 2002:a05:6102:5e81:b0:5dd:8819:e68a with SMTP id ada2fe7eead31-5eb1a8122f2mr1835491137.36.1766236524424; Sat, 20 Dec 2025 05:15:24 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: jian he Date: Sat, 20 Dec 2025 21:14:46 +0800 X-Gm-Features: AQt7F2qoDetS8vgGo5ydm1lxCjee-5ubD3YxcnAjwscSFIDkr7A5nZ-lJKOMQzo Message-ID: Subject: Re: SQL-level pg_datum_image_equal To: Matthias van de Meent 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 On Thu, Dec 11, 2025 at 1:46=E2=80=AFAM Matthias van de Meent wrote: > > Hi, > > > So, attached is a simple and to-the-point patch that adds the function > mentioned in $subject, which will tell the user whether two values of > the same type have an exactly equal binary representation, using > datum_image_eq. > hi. maybe Table 9.76 (https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-INFO= -CATALOG) is the right place for this function. corner case confused me, I think this is related to null handling, maybe not related to this. create type t1 as (a int, b text); select pg_datum_image_equal('(,)'::t1, $$(,)$$::t1); select pg_datum_image_equal('(,)'::t1, NULL::t1); select '(,)'::t1 is null, NULL::t1 is null; enforce_generic_type_consistency already resolved generic type. see select pg_datum_image_equal('1','1'); ERROR: could not determine polymorphic type because input has type unknown so + if (!OidIsValid(typ)) + { + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("could not determine type"))); + } this part should be elog(ERROR.....) ? -- jian https://www.enterprisedb.com/