2 -- first, define the datatype. Turn off echoing so that expected file
3 -- does not depend on `CREATE EXTENSION wildspeed` output.
6 SET client_min_messages = warning;
8 CREATE EXTENSION wildspeed;
10 RESET client_min_messages;
16 SELECT permute('hello');
18 CREATE TABLE testlike ( t text );
19 \copy testlike from 'data/testlike.data'
20 INSERT INTO testlike VALUES ('');
22 SELECT * FROM testlike WHERE t LIKE '' ORDER BY t;
23 SELECT * FROM testlike WHERE t LIKE '%' ORDER BY t;
24 SELECT * FROM testlike WHERE t LIKE 'hello' ORDER BY t;
25 SELECT * FROM testlike WHERE t LIKE 'hello%' ORDER BY t;
26 SELECT * FROM testlike WHERE t LIKE 'hel%' ORDER BY t;
27 SELECT * FROM testlike WHERE t LIKE '%hello' ORDER BY t;
28 SELECT * FROM testlike WHERE t LIKE '%lo' ORDER BY t;
29 SELECT * FROM testlike WHERE t LIKE '%hello%' ORDER BY t;
30 SELECT * FROM testlike WHERE t LIKE '%ll%' ORDER BY t;
31 SELECT * FROM testlike WHERE t LIKE 'h%o' ORDER BY t;
32 SELECT * FROM testlike WHERE t LIKE 'h%l%o' ORDER BY t;
33 SELECT * FROM testlike WHERE t LIKE 'h%l%o' ORDER BY t;
34 SELECT * FROM testlike WHERE t LIKE 'h%e%l%o' ORDER BY t;
35 SELECT * FROM testlike WHERE t LIKE '%e%l%' ORDER BY t;
36 SELECT * FROM testlike WHERE t LIKE '%e%o' ORDER BY t;
37 SELECT * FROM testlike WHERE t LIKE 'h%o%' ORDER BY t;
38 SELECT * FROM testlike WHERE t LIKE 'j%e%' ORDER BY t;
39 SELECT * FROM testlike WHERE t LIKE 'j%k%' ORDER BY t;
40 SELECT * FROM testlike WHERE t LIKE 'h%k%' ORDER BY t;
42 CREATE INDEX like_idx ON testlike USING gin ( t wildcard_ops );
44 SET enable_seqscan=off;
46 SELECT * FROM testlike WHERE t LIKE '' ORDER BY t;
47 SELECT * FROM testlike WHERE t LIKE '%' ORDER BY t;
48 SELECT * FROM testlike WHERE t LIKE 'hello' ORDER BY t;
49 SELECT * FROM testlike WHERE t LIKE 'hello%' ORDER BY t;
50 SELECT * FROM testlike WHERE t LIKE 'hel%' ORDER BY t;
51 SELECT * FROM testlike WHERE t LIKE '%hello' ORDER BY t;
52 SELECT * FROM testlike WHERE t LIKE '%lo' ORDER BY t;
53 SELECT * FROM testlike WHERE t LIKE '%hello%' ORDER BY t;
54 SELECT * FROM testlike WHERE t LIKE '%ll%' ORDER BY t;
55 SELECT * FROM testlike WHERE t LIKE 'h%o' ORDER BY t;
56 SELECT * FROM testlike WHERE t LIKE 'h%l%o' ORDER BY t;
57 SELECT * FROM testlike WHERE t LIKE 'h%l%o' ORDER BY t;
58 SELECT * FROM testlike WHERE t LIKE 'h%e%l%o' ORDER BY t;
59 SELECT * FROM testlike WHERE t LIKE '%e%l%' ORDER BY t;
60 SELECT * FROM testlike WHERE t LIKE '%e%o' ORDER BY t;
61 SELECT * FROM testlike WHERE t LIKE 'h%o%' ORDER BY t;
62 SELECT * FROM testlike WHERE t LIKE 'j%e%' ORDER BY t;
63 SELECT * FROM testlike WHERE t LIKE 'j%k%' ORDER BY t;
64 SELECT * FROM testlike WHERE t LIKE 'h%k%' ORDER BY t;