Re: ERROR: failed to find conversion function from key_vals_nn to record[]

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ERROR: failed to find conversion function from key_vals_nn to record[]
Дата
Msg-id 913265.1655391267@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: ERROR: failed to find conversion function from key_vals_nn to record[]  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
"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

diff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.c
index 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;

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re:
Следующее
От: Daniel Popowich
Дата:
Сообщение: Operators on ranges with a domain subtype do not implicitly cast operands of the domain's base type