Fuzzystrmatch Postgresql similarity func with array How do I pass an array to the SIMILARITY ()function

I am looking for something similar to the following:


SELECT denomination, is_active 
   FROM MyTable WHERE 
SIMILARITY(denomination, ['Coke', 'Coque']) &gt; 0.4;
The similarity function does not take in array as argument so it will not do what you want out of the box

You have a couple of options create a wrapper function that takes in array that the calls Similarity and returns a value to compare against.

2nd option is do a cross join to the array like so

SELECT denomination, is_active , unnest  
    FROM mytable  cross join ( 
        select * from 
        unnest(array['coke', 'coqe'])
    ) dd
    where SIMILARITY(denomination, unnest) &gt; 0.4;