Re: BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type
Дата
Msg-id 3536307.1703952795@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> One particular query outputs unexpected error instead of result data. This
> behaviour is strange while change of order of columns seems to avoid issue.
> Also removing DINSTINCT keyword in first column or WHERE statement in second
> column also somehow avoid issue. I was able to isolate part that causes
> problems and write following test case: 

> SELECT
> string_agg(DISTINCT 'a', ', ') agg,
> sum(
>   (
>     SELECT sum(1)
>     FROM (SELECT id FROM unnest(array[1]) id) B
>     WHERE  A.id = B.id
>   )
> ) sum
> FROM (SELECT id FROM unnest(array[1]) id) A;

> Both psql and pgadmin outputs this:
> ERROR:  attribute 1 of type record has wrong type
> SQL status: 42804
> Detail: Table has type text, but query expects integer.

Thanks for the report!  Bisecting shows it broke at

1349d2790bf48a4de072931c722f39337e72055e is the first bad commit
commit 1349d2790bf48a4de072931c722f39337e72055e
Author: David Rowley <drowley@postgresql.org>
Date:   Tue Aug 2 23:11:45 2022 +1200

    Improve performance of ORDER BY / DISTINCT aggregates

            regards, tom lane



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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type
Следующее
От: David Rowley
Дата:
Сообщение: Re: BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type