Arrays and ANY problem - Mailing list pgsql-general

From David Salisbury
Subject Arrays and ANY problem
Date
Msg-id CAKXTjVmV+mHXvzCKtKuHeooYYObNQhST7eG7kJmUcJy7=1cqTg@mail.gmail.com
Whole thread Raw
Responses Re: Arrays and ANY problem
Re: Arrays and ANY problem
List pgsql-general
Perhaps someone can guide me here as I'm having a "moment". :)

Not sure why I am getting 0 rows returned here:

db=# \d table_name_ds_tmp

   Column   |       Type        | Modifiers
------------+-------------------+-----------
 categoryid | bigint            |
 name       | character varying |

db=# select * from table_name_ds_tmp;
 categoryid | name  
------------+-------
        100 | one
        200 | two
        300 | three
        400 | four
(4 rows)

db=# select name from table_name_ds_tmp where ARRAY[categoryid] = ANY ( select string_to_array( '200,400', ',')::bigint[] );
 name
------
(0 rows)

I would expect, and am in need of, the query returning these 2 rows, 
"two"
"four"
which I plan to aggregate together later on with array_to_string.  

Basically I hope to take a string and substitute the values in it with their associated values.

Other incantations and permutations just seem to give me various error messages.

Thanks for any help.




pgsql-general by date:

Previous
From: PegoraroF10
Date:
Subject: Re: Operator is not unique
Next
From: Michael Lewis
Date:
Subject: Re: Arrays and ANY problem