On Fri, Apr 12, 2024 at 10:32 AM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 18430
> Logged by: Eric Atkin
> Email address: eatkin(at)certusllc(dot)us
> PostgreSQL version: 16.2
> Operating system: Arch Linux
> Description:
>
> (SELECT count(*) FROM delivery WHERE driver_id IN array_agg(driver.id
> ))
>
>
This doesn't seem to have anything to do with scoping of inner and outer
queries. Where did you come to believe that:
scalar IN array
is a valid operator/expression.
i.e., your query fails for the same reason this one does:
select 1 in array[1,2,3];
David J.