2 -- first, define the datatype. Turn off echoing so that expected file
3 -- does not depend on contents of wildspeed.sql.
5 SET client_min_messages = warning;
7 RESET client_min_messages;
26 SELECT permute('hello');
28 --------------------------------------
29 {hello$,ello$h,llo$he,lo$hel,o$hell}
32 CREATE TABLE testlike ( t text );
33 \copy testlike from 'data/testlike.data'
34 INSERT INTO testlike VALUES ('');
35 SELECT * FROM testlike WHERE t LIKE '' ORDER BY t;
41 SELECT * FROM testlike WHERE t LIKE '%' ORDER BY t;
56 SELECT * FROM testlike WHERE t LIKE 'hello' ORDER BY t;
62 SELECT * FROM testlike WHERE t LIKE 'hello%' ORDER BY t;
68 SELECT * FROM testlike WHERE t LIKE 'hel%' ORDER BY t;
76 SELECT * FROM testlike WHERE t LIKE '%hello' ORDER BY t;
82 SELECT * FROM testlike WHERE t LIKE '%lo' ORDER BY t;
90 SELECT * FROM testlike WHERE t LIKE '%hello%' ORDER BY t;
96 SELECT * FROM testlike WHERE t LIKE '%ll%' ORDER BY t;
106 SELECT * FROM testlike WHERE t LIKE 'h%o' ORDER BY t;
115 SELECT * FROM testlike WHERE t LIKE 'h%l%o' ORDER BY t;
123 SELECT * FROM testlike WHERE t LIKE 'h%l%o' ORDER BY t;
131 SELECT * FROM testlike WHERE t LIKE 'h%e%l%o' ORDER BY t;
138 SELECT * FROM testlike WHERE t LIKE '%e%l%' ORDER BY t;
149 SELECT * FROM testlike WHERE t LIKE '%e%o' ORDER BY t;
159 SELECT * FROM testlike WHERE t LIKE 'h%o%' ORDER BY t;
168 SELECT * FROM testlike WHERE t LIKE 'j%e%' ORDER BY t;
177 SELECT * FROM testlike WHERE t LIKE 'j%k%' ORDER BY t;
183 SELECT * FROM testlike WHERE t LIKE 'h%k%' ORDER BY t;
190 CREATE INDEX like_idx ON testlike USING gin ( t wildcard_ops );
191 SET enable_seqscan=off;
192 SELECT * FROM testlike WHERE t LIKE '' ORDER BY t;
198 SELECT * FROM testlike WHERE t LIKE '%' ORDER BY t;
213 SELECT * FROM testlike WHERE t LIKE 'hello' ORDER BY t;
219 SELECT * FROM testlike WHERE t LIKE 'hello%' ORDER BY t;
225 SELECT * FROM testlike WHERE t LIKE 'hel%' ORDER BY t;
233 SELECT * FROM testlike WHERE t LIKE '%hello' ORDER BY t;
239 SELECT * FROM testlike WHERE t LIKE '%lo' ORDER BY t;
247 SELECT * FROM testlike WHERE t LIKE '%hello%' ORDER BY t;
253 SELECT * FROM testlike WHERE t LIKE '%ll%' ORDER BY t;
263 SELECT * FROM testlike WHERE t LIKE 'h%o' ORDER BY t;
272 SELECT * FROM testlike WHERE t LIKE 'h%l%o' ORDER BY t;
280 SELECT * FROM testlike WHERE t LIKE 'h%l%o' ORDER BY t;
288 SELECT * FROM testlike WHERE t LIKE 'h%e%l%o' ORDER BY t;
295 SELECT * FROM testlike WHERE t LIKE '%e%l%' ORDER BY t;
306 SELECT * FROM testlike WHERE t LIKE '%e%o' ORDER BY t;
316 SELECT * FROM testlike WHERE t LIKE 'h%o%' ORDER BY t;
325 SELECT * FROM testlike WHERE t LIKE 'j%e%' ORDER BY t;
334 SELECT * FROM testlike WHERE t LIKE 'j%k%' ORDER BY t;
340 SELECT * FROM testlike WHERE t LIKE 'h%k%' ORDER BY t;