@@ -3706,3 +3706,135 @@ select * from test2 where t ilike 'qua%';
3706
3706
quark
3707
3707
(1 row)
3708
3708
3709
+ select * from test2 where t like '%z foo bar%';
3710
+ t
3711
+ -------------
3712
+ z foo bar
3713
+ (1 row)
3714
+
3715
+ select * from test2 where t like ' z foo%';
3716
+ t
3717
+ -------------
3718
+ z foo bar
3719
+ (1 row)
3720
+
3721
+ explain (costs off)
3722
+ select * from test2 where t ~ '[abc]{3}';
3723
+ QUERY PLAN
3724
+ ------------------------------------------
3725
+ Index Scan using test2_idx_gist on test2
3726
+ Index Cond: (t ~ '[abc]{3}'::text)
3727
+ (2 rows)
3728
+
3729
+ explain (costs off)
3730
+ select * from test2 where t ~* 'DEF';
3731
+ QUERY PLAN
3732
+ ------------------------------------------
3733
+ Index Scan using test2_idx_gist on test2
3734
+ Index Cond: (t ~* 'DEF'::text)
3735
+ (2 rows)
3736
+
3737
+ select * from test2 where t ~ '[abc]{3}';
3738
+ t
3739
+ --------
3740
+ abcdef
3741
+ (1 row)
3742
+
3743
+ select * from test2 where t ~ 'a[bc]+d';
3744
+ t
3745
+ --------
3746
+ abcdef
3747
+ (1 row)
3748
+
3749
+ select * from test2 where t ~ '(abc)*$';
3750
+ t
3751
+ -------------
3752
+ abcdef
3753
+ quark
3754
+ z foo bar
3755
+ (3 rows)
3756
+
3757
+ select * from test2 where t ~* 'DEF';
3758
+ t
3759
+ --------
3760
+ abcdef
3761
+ (1 row)
3762
+
3763
+ select * from test2 where t ~ 'dEf';
3764
+ t
3765
+ ---
3766
+ (0 rows)
3767
+
3768
+ select * from test2 where t ~* '^q';
3769
+ t
3770
+ -------
3771
+ quark
3772
+ (1 row)
3773
+
3774
+ select * from test2 where t ~* '[abc]{3}[def]{3}';
3775
+ t
3776
+ --------
3777
+ abcdef
3778
+ (1 row)
3779
+
3780
+ select * from test2 where t ~* 'ab[a-z]{3}';
3781
+ t
3782
+ --------
3783
+ abcdef
3784
+ (1 row)
3785
+
3786
+ select * from test2 where t ~* '(^| )qua';
3787
+ t
3788
+ -------
3789
+ quark
3790
+ (1 row)
3791
+
3792
+ select * from test2 where t ~ 'q.*rk$';
3793
+ t
3794
+ -------
3795
+ quark
3796
+ (1 row)
3797
+
3798
+ select * from test2 where t ~ 'q';
3799
+ t
3800
+ -------
3801
+ quark
3802
+ (1 row)
3803
+
3804
+ select * from test2 where t ~ '[a-z]{3}';
3805
+ t
3806
+ -------------
3807
+ abcdef
3808
+ quark
3809
+ z foo bar
3810
+ (3 rows)
3811
+
3812
+ select * from test2 where t ~* '(a{10}|b{10}|c{10}){10}';
3813
+ t
3814
+ ---
3815
+ (0 rows)
3816
+
3817
+ select * from test2 where t ~ 'z foo bar';
3818
+ t
3819
+ -------------
3820
+ z foo bar
3821
+ (1 row)
3822
+
3823
+ select * from test2 where t ~ ' z foo bar';
3824
+ t
3825
+ -------------
3826
+ z foo bar
3827
+ (1 row)
3828
+
3829
+ select * from test2 where t ~ ' z foo bar';
3830
+ t
3831
+ -------------
3832
+ z foo bar
3833
+ (1 row)
3834
+
3835
+ select * from test2 where t ~ ' z foo';
3836
+ t
3837
+ -------------
3838
+ z foo bar
3839
+ (1 row)
3840
+
0 commit comments