From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Bryn Llewellyn <bryn@yugabyte.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: ERROR: failed to find conversion function from key_vals_nn to record[]
Date: Thu, 16 Jun 2022 10:54:27 -0400
Message-ID: <913265.1655391267@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZordXQdGAFuuVabhsoCN8ecmo4cbt89LcUmRSvTCEr+A@mail.gmail.com>
References: <37D76918-6FD7-4598-A409-A7091687D8E6@yugabyte.com>
<CAKFQuwZordXQdGAFuuVabhsoCN8ecmo4cbt89LcUmRSvTCEr+A@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> The fact that a domain over an array isn’t being seen as an array here
> seems like a bug.
Hmm. The attached quick-hack patch seems to make this better, but
I'm not sure whether there are any cases it makes worse.
regards, tom lane
Attachments:treat-RECORD-as-polymorphic-in-ScalarArray-Op-1.patch (text/x-diff, 837B) downloaddiff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.cindex cf64afbd85..f36b23092d 100644--- a/src/backend/parser/parse_oper.c+++ b/src/backend/parser/parse_oper.c@@ -867,9 +867,11 @@ make_scalar_array_op(ParseState *pstate, List *opname,
* Now switch back to the array type on the right, arranging for any
* needed cast to be applied. Beware of polymorphic operators here;
* enforce_generic_type_consistency may or may not have replaced a
- * polymorphic type with a real one.+ * polymorphic type with a real one. RECORD acts like a polymorphic type+ * for this purpose, too.
*/
- if (IsPolymorphicType(declared_arg_types[1]))+ if (IsPolymorphicType(declared_arg_types[1]) ||+ declared_arg_types[1] == RECORDOID)
{
/* assume the actual array type is OK */
res_atypeId = atypeId;
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, bryn@yugabyte.com
Subject: Re: ERROR: failed to find conversion function from key_vals_nn to record[]
In-Reply-To: <913265.1655391267@sss.pgh.pa.us>
References: <37D76918-6FD7-4598-A409-A7091687D8E6@yugabyte.com> <CAKFQuwZordXQdGAFuuVabhsoCN8ecmo4cbt89LcUmRSvTCEr+A@mail.gmail.com> <913265.1655391267@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox