pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: vojtech.benes@centrum.cz
Cc: pgsql-bugs@lists.postgresql.org, David Rowley <dgrowleyml@gmail.com>
Subject: Re: BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type
Date: Sat, 30 Dec 2023 11:13:15 -0500
Message-ID: <3536307.1703952795@sss.pgh.pa.us> (raw)
In-Reply-To: <18264-e363593d7e9feb7d@postgresql.org>
References: <18264-e363593d7e9feb7d@postgresql.org>

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





view thread (5+ messages)  latest in thread

Message-ID: <3536307.1703952795@sss.pgh.pa.us>
Permalink:  ../3536307.1703952795@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3536307.1703952795@sss.pgh.pa.us

 · 

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 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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, vojtech.benes@centrum.cz, dgrowleyml@gmail.com
  Subject: Re: BUG #18264: Table has type text, but query expects integer.attribute 1 of type record has wrong type
  In-Reply-To: <3536307.1703952795@sss.pgh.pa.us>
  References: <18264-e363593d7e9feb7d@postgresql.org> <3536307.1703952795@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