public inbox for [email protected]  
help / color / mirror / Atom feed
From: jian he <[email protected]>
To: Matthias van de Meent <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: SQL-level pg_datum_image_equal
Date: Sat, 20 Dec 2025 21:14:46 +0800
Message-ID: <CACJufxFV5KqmF86upFmX2tPzfKMWjWNf8+uYiYufLKatOsYXQw@mail.gmail.com> (raw)
In-Reply-To: <CAEze2WhsqYjg0oGY+7yooimUK7zRc9PY9u8u-Oo=VmJ+DAAkKg@mail.gmail.com>
References: <CAEze2WhsqYjg0oGY+7yooimUK7zRc9PY9u8u-Oo=VmJ+DAAkKg@mail.gmail.com>

On Thu, Dec 11, 2025 at 1:46 AM Matthias van de Meent
<[email protected]> 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/





view thread (11+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: SQL-level pg_datum_image_equal
  In-Reply-To: <CACJufxFV5KqmF86upFmX2tPzfKMWjWNf8+uYiYufLKatOsYXQw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox