Re: BUG #17564: Planner bug in combination of generate_series(), unnest() and ORDER BY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: kleptog(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17564: Planner bug in combination of generate_series(), unnest() and ORDER BY
Date: 2022-08-01 22:17:11
Message-ID: 2184335.1659392231@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> db=# explain SELECT generate_subscripts(ARRAY[]::integer[], 1) AS id,
> unnest(ARRAY[]::jsonb[]) ->> 'timestamp' AS timestamp
> FROM results
> JOIN groups ON groups.id = results.group_id
> WHERE results.search_id = 3336
> order by timestamp;

> The error is:

> ERROR: set-valued function called in context that cannot accept a set
> LINE 2: unnest(ARRAY[]::jsonb[]) ->> 'timestamp' AS timestam...

Hmm, that certainly seems like a bug, but I fear it's impossible
to investigate without a reproducible test case.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-08-01 22:21:18 Re: BUG #17565: Extended query protocol incorrectly sets TBLOCK_STARTED even though multiple queries can be executed
Previous Message PG Bug reporting form 2022-08-01 20:12:00 BUG #17565: Extended query protocol incorrectly sets TBLOCK_STARTED even though multiple queries can be executed