clear markdown compare help donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 462180 distinct fiddles created so far.

CREATE OR REPLACE FUNCTION like_in_array(_arr text[], _pattern text) RETURNS bool LANGUAGE sql IMMUTABLE AS 'SELECT EXISTS (SELECT 1 FROM unnest($1) n WHERE n ~~ $2)';
 hidden batch(es)


CREATE OPERATOR ~~ ( LEFTARG = TEXT[], RIGHTARG = TEXT, PROCEDURE = like_in_array );
 hidden batch(es)


SELECT ARRAY['foobar', 'barbar', 'bazbar'] LIKE 'foo%' , ARRAY['foobar', 'barbar', 'bazbar'] LIKE '%foo2%';
?column? ?column?
t f
 hidden batch(es)


SELECT (ARRAY['foobar', 'barbar', 'bazbar'])::text LIKE '%foo%' , (ARRAY['foobar', 'barbar', 'bazbar'])::text LIKE '%foo2%';
?column? ?column?
t f
 hidden batch(es)


SELECT (ARRAY['foo bar', 'barbar', 'bazbar'])::text ~ '[{",]foo' , (ARRAY['foo bar', 'barbar', 'bazbar'])::text ~ '[{",]foo2';
?column? ?column?
t f
 hidden batch(es)