Re: Arrays and ANY problem - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Arrays and ANY problem
Date
Msg-id 775E048E-4316-4AFE-B4A7-A25AC79DE002@gmail.com
Whole thread Raw
In response to Arrays and ANY problem  (David Salisbury <dsalis@ucar.edu>)
Responses Re: Arrays and ANY problem
List pgsql-general
> On 25 Sep 2019, at 22:25, David Salisbury <dsalis@ucar.edu> wrote:
> db=# select name from table_name_ds_tmp where ARRAY[categoryid] = ANY ( select string_to_array( '200,400',
',')::bigint[]); 
>  name
> ------
> (0 rows)

You are comparing two arrays for equality. Since the left-hand array has only 1 item and the right-hand one has two,
there’snot much equality between them. 

You probably meant:
select name from table_name_ds_tmp where categoryid = ANY ( select string_to_array( '200,400', ',')::bigint[] );


Alban Hertroys
--
There is always an exception to always.







pgsql-general by date:

Previous
From: Michael Lewis
Date:
Subject: Re: Arrays and ANY problem
Next
From: Alban Hertroys
Date:
Subject: Re: Arrays and ANY problem