Skip to content

Commit 55e7037

Browse files
committed
rename <-> to <=> for timestamp and tsvector
1 parent 617cc12 commit 55e7037

File tree

8 files changed

+59
-59
lines changed

8 files changed

+59
-59
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The module provides new operators.
3434

3535
| Operator | Returns | Description
3636
| -------------------- | ------- | ----------------------------------------------
37-
| tsvector &lt;-&gt; tsquery | float4 | Returns distance between tsvector and tsquery.
37+
| tsvector &lt;=&gt; tsquery | float4 | Returns distance between tsvector and tsquery.
3838

3939
## Examples
4040

@@ -67,21 +67,21 @@ CREATE INDEX rumidx ON test_rum USING rum (a rum_tsvector_ops);
6767
And we can execute the following queries:
6868

6969
```sql
70-
=# SELECT t, a <-> to_tsquery('english', 'beautiful | place') AS rank
70+
=# SELECT t, a <=> to_tsquery('english', 'beautiful | place') AS rank
7171
FROM test_rum
7272
WHERE a @@ to_tsquery('english', 'beautiful | place')
73-
ORDER BY a <-> to_tsquery('english', 'beautiful | place');
73+
ORDER BY a <=> to_tsquery('english', 'beautiful | place');
7474
t | rank
7575
---------------------------------+-----------
7676
The situation is most beautiful | 0.0303964
7777
It is a beautiful | 0.0303964
7878
It looks like a beautiful place | 0.0607927
7979
(3 rows)
8080

81-
=# SELECT t, a <-> to_tsquery('english', 'place | situation') AS rank
81+
=# SELECT t, a <=> to_tsquery('english', 'place | situation') AS rank
8282
FROM test_rum
8383
WHERE a @@ to_tsquery('english', 'place | situation')
84-
ORDER BY a <-> to_tsquery('english', 'place | situation');
84+
ORDER BY a <=> to_tsquery('english', 'place | situation');
8585
t | rank
8686
---------------------------------+-----------
8787
The situation is most beautiful | 0.0303964

expected/orderby.out

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ SELECT count(*) FROM tsts WHERE t @@ '(eq|yt)&(wr|qh)';
4343
SET enable_indexscan=OFF;
4444
SET enable_indexonlyscan=OFF;
4545
SET enable_bitmapscan=OFF;
46-
SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-> '2016-05-16 14:21:25' LIMIT 5;
46+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
4747
id | d | ?column?
4848
-----+---------------------------------+---------------
4949
355 | Mon May 16 14:21:22.326724 2016 | 2.673276
@@ -53,7 +53,7 @@ SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY
5353
415 | Thu May 19 02:21:22.326724 2016 | 215997.326724
5454
(5 rows)
5555

56-
SELECT id, d, d <-| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-| '2016-05-16 14:21:25' LIMIT 5;
56+
SELECT id, d, d <=| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5;
5757
id | d | ?column?
5858
-----+---------------------------------+---------------
5959
355 | Mon May 16 14:21:22.326724 2016 | 2.673276
@@ -63,7 +63,7 @@ SELECT id, d, d <-| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY
6363
168 | Sun May 08 19:21:22.326724 2016 | 673202.673276
6464
(5 rows)
6565

66-
SELECT id, d, d |-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |-> '2016-05-16 14:21:25' LIMIT 5;
66+
SELECT id, d, d |=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5;
6767
id | d | ?column?
6868
-----+---------------------------------+---------------
6969
371 | Tue May 17 06:21:22.326724 2016 | 57597.326724
@@ -125,16 +125,16 @@ SELECT count(*) FROM tsts WHERE t @@ '(eq|yt)&(wr|qh)';
125125
(1 row)
126126

127127
EXPLAIN (costs off)
128-
SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-> '2016-05-16 14:21:25' LIMIT 5;
128+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
129129
QUERY PLAN
130130
-----------------------------------------------------------------------------------
131131
Limit
132132
-> Index Scan using tsts_idx on tsts
133133
Index Cond: (t @@ '''wr'' & ''qh'''::tsquery)
134-
Order By: (d <-> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
134+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
135135
(4 rows)
136136

137-
SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-> '2016-05-16 14:21:25' LIMIT 5;
137+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
138138
id | d | ?column?
139139
-----+---------------------------------+---------------
140140
355 | Mon May 16 14:21:22.326724 2016 | 2.673276
@@ -145,16 +145,16 @@ SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY
145145
(5 rows)
146146

147147
EXPLAIN (costs off)
148-
SELECT id, d, d <-| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-| '2016-05-16 14:21:25' LIMIT 5;
148+
SELECT id, d, d <=| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5;
149149
QUERY PLAN
150150
-----------------------------------------------------------------------------------
151151
Limit
152152
-> Index Scan using tsts_idx on tsts
153153
Index Cond: (t @@ '''wr'' & ''qh'''::tsquery)
154-
Order By: (d <-| 'Mon May 16 14:21:25 2016'::timestamp without time zone)
154+
Order By: (d <=| 'Mon May 16 14:21:25 2016'::timestamp without time zone)
155155
(4 rows)
156156

157-
SELECT id, d, d <-| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-| '2016-05-16 14:21:25' LIMIT 5;
157+
SELECT id, d, d <=| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5;
158158
id | d | ?column?
159159
-----+---------------------------------+---------------
160160
355 | Mon May 16 14:21:22.326724 2016 | 2.673276
@@ -165,16 +165,16 @@ SELECT id, d, d <-| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY
165165
(5 rows)
166166

167167
EXPLAIN (costs off)
168-
SELECT id, d, d |-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |-> '2016-05-16 14:21:25' LIMIT 5;
168+
SELECT id, d, d |=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5;
169169
QUERY PLAN
170170
-----------------------------------------------------------------------------------
171171
Limit
172172
-> Index Scan using tsts_idx on tsts
173173
Index Cond: (t @@ '''wr'' & ''qh'''::tsquery)
174-
Order By: (d |-> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
174+
Order By: (d |=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
175175
(4 rows)
176176

177-
SELECT id, d, d |-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |-> '2016-05-16 14:21:25' LIMIT 5;
177+
SELECT id, d, d |=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5;
178178
id | d | ?column?
179179
-----+---------------------------------+---------------
180180
371 | Tue May 17 06:21:22.326724 2016 | 57597.326724
@@ -185,15 +185,15 @@ SELECT id, d, d |-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY
185185
(5 rows)
186186

187187
EXPLAIN (costs off)
188-
SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts ORDER BY d <-> '2016-05-16 14:21:25' LIMIT 5;
188+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
189189
QUERY PLAN
190190
-----------------------------------------------------------------------------------
191191
Limit
192192
-> Index Scan using tsts_idx on tsts
193-
Order By: (d <-> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
193+
Order By: (d <=> 'Mon May 16 14:21:25 2016'::timestamp without time zone)
194194
(3 rows)
195195

196-
SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts ORDER BY d <-> '2016-05-16 14:21:25' LIMIT 5;
196+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
197197
id | d | ?column?
198198
-----+---------------------------------+-------------
199199
355 | Mon May 16 14:21:22.326724 2016 | 2.673276

expected/rum.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english', 'ever|
1919

2020
explain (costs off)
2121
SELECT * FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english', 'ever|wrote')
22-
ORDER BY a <-> to_tsquery('pg_catalog.english', 'ever|wrote');
22+
ORDER BY a <=> to_tsquery('pg_catalog.english', 'ever|wrote');
2323
QUERY PLAN
2424
------------------------------------------------------------------
2525
Sort
26-
Sort Key: ((a <-> '''ever'' | ''wrote'''::tsquery))
26+
Sort Key: ((a <=> '''ever'' | ''wrote'''::tsquery))
2727
-> Bitmap Heap Scan on test_rum
2828
Recheck Cond: (a @@ '''ever'' | ''wrote'''::tsquery)
2929
-> Bitmap Index Scan on rumidx
@@ -93,7 +93,7 @@ SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english',
9393
SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way')), *
9494
FROM test_rum
9595
WHERE a @@ to_tsquery('pg_catalog.english', 'way')
96-
ORDER BY a <-> to_tsquery('pg_catalog.english', 'way');
96+
ORDER BY a <=> to_tsquery('pg_catalog.english', 'way');
9797
rum_ts_distance | t | a
9898
-----------------+--------------------------------------------------------------------------+---------------------------------------------------------------
9999
16.4493 | my appreciation of you in a more complimentary way than by sending this | 'appreci':2 'complimentari':8 'send':12 'way':9
@@ -105,19 +105,19 @@ SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way')), *
105105
SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')), *
106106
FROM test_rum
107107
WHERE a @@ to_tsquery('pg_catalog.english', 'way & (go | half)')
108-
ORDER BY a <-> to_tsquery('pg_catalog.english', 'way & (go | half)');
108+
ORDER BY a <=> to_tsquery('pg_catalog.english', 'way & (go | half)');
109109
rum_ts_distance | t | a
110110
-----------------+---------------------------------------------------------------------+---------------------------------------------------------
111111
9.65659 | thinking--“to go or not to go?” We are this far on the way. Reached | 'far':11 'go':3,7 'reach':15 'think':1 'way':14
112112
10.0905 | itself. Put on your “specs” and look at the castle, half way up the | 'castl':10 'half':11 'look':7 'put':2 'spec':5 'way':12
113113
(2 rows)
114114

115115
SELECT
116-
a <-> to_tsquery('pg_catalog.english', 'way & (go | half)'),
116+
a <=> to_tsquery('pg_catalog.english', 'way & (go | half)'),
117117
rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')),
118118
*
119119
FROM test_rum
120-
ORDER BY a <-> to_tsquery('pg_catalog.english', 'way & (go | half)') limit 2;
120+
ORDER BY a <=> to_tsquery('pg_catalog.english', 'way & (go | half)') limit 2;
121121
?column? | rum_ts_distance | t | a
122122
----------+-----------------+---------------------------------------------------------------------+---------------------------------------------------------
123123
9.65659 | 9.65659 | thinking--“to go or not to go?” We are this far on the way. Reached | 'far':11 'go':3,7 'reach':15 'think':1 'way':14

expected/timestamp.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ INSERT INTO test_timestamp VALUES
99
( '2004-10-26 09:55:08' ),
1010
( '2004-10-26 10:55:08' )
1111
;
12-
SELECT i <-> '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
12+
SELECT i <=> '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
1313
?column? | i
1414
----------+--------------------------
1515
1740 | Tue Oct 26 05:55:08 2004
@@ -20,7 +20,7 @@ SELECT i <-> '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
2020
16260 | Tue Oct 26 10:55:08 2004
2121
(6 rows)
2222

23-
SELECT i <-| '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
23+
SELECT i <=| '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
2424
?column? | i
2525
----------+--------------------------
2626
1740 | Tue Oct 26 05:55:08 2004
@@ -31,7 +31,7 @@ SELECT i <-| '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
3131
Infinity | Tue Oct 26 10:55:08 2004
3232
(6 rows)
3333

34-
SELECT i |-> '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
34+
SELECT i |=> '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
3535
?column? | i
3636
----------+--------------------------
3737
9060 | Tue Oct 26 08:55:08 2004

rum--1.0.sql

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RETURNS float4
1212
AS 'MODULE_PATHNAME'
1313
LANGUAGE C IMMUTABLE STRICT;
1414

15-
CREATE OPERATOR <-> (
15+
CREATE OPERATOR <=> (
1616
LEFTARG = tsvector,
1717
RIGHTARG = tsquery,
1818
PROCEDURE = rum_ts_distance
@@ -52,7 +52,7 @@ CREATE OPERATOR CLASS rum_tsvector_ops
5252
FOR TYPE tsvector USING rum
5353
AS
5454
OPERATOR 1 @@ (tsvector, tsquery),
55-
OPERATOR 2 <-> (tsvector, tsquery) FOR ORDER BY pg_catalog.float_ops,
55+
OPERATOR 2 <=> (tsvector, tsquery) FOR ORDER BY pg_catalog.float_ops,
5656
FUNCTION 1 gin_cmp_tslexeme(text, text),
5757
FUNCTION 2 rum_extract_tsvector(tsvector,internal,internal,internal,internal),
5858
FUNCTION 3 rum_extract_tsquery(tsquery,internal,smallint,internal,internal,internal,internal),
@@ -70,35 +70,35 @@ RETURNS float8
7070
AS 'MODULE_PATHNAME'
7171
LANGUAGE C IMMUTABLE STRICT;
7272

73-
CREATE OPERATOR <-> (
73+
CREATE OPERATOR <=> (
7474
PROCEDURE = timestamp_distance,
7575
LEFTARG = timestamp,
7676
RIGHTARG = timestamp,
77-
COMMUTATOR = <->
77+
COMMUTATOR = <=>
7878
);
7979

8080
CREATE FUNCTION timestamp_left_distance(timestamp, timestamp)
8181
RETURNS float8
8282
AS 'MODULE_PATHNAME'
8383
LANGUAGE C IMMUTABLE STRICT;
8484

85-
CREATE OPERATOR <-| (
85+
CREATE OPERATOR <=| (
8686
PROCEDURE = timestamp_left_distance,
8787
LEFTARG = timestamp,
8888
RIGHTARG = timestamp,
89-
COMMUTATOR = |->
89+
COMMUTATOR = |=>
9090
);
9191

9292
CREATE FUNCTION timestamp_right_distance(timestamp, timestamp)
9393
RETURNS float8
9494
AS 'MODULE_PATHNAME'
9595
LANGUAGE C IMMUTABLE STRICT;
9696

97-
CREATE OPERATOR |-> (
97+
CREATE OPERATOR |=> (
9898
PROCEDURE = timestamp_right_distance,
9999
LEFTARG = timestamp,
100100
RIGHTARG = timestamp,
101-
COMMUTATOR = <-|
101+
COMMUTATOR = <=|
102102
);
103103

104104

@@ -145,9 +145,9 @@ AS
145145
FUNCTION 5 rum_timestamp_compare_prefix(timestamp,timestamp,smallint,internal),
146146
-- support to timestamp disttance in rum_tsvector_timestamp_ops
147147
FUNCTION 9 rum_timestamp_outer_distance(timestamp, timestamp, smallint),
148-
OPERATOR 20 <-> (timestamp,timestamp) FOR ORDER BY pg_catalog.float_ops,
149-
OPERATOR 21 <-| (timestamp,timestamp) FOR ORDER BY pg_catalog.float_ops,
150-
OPERATOR 22 |-> (timestamp,timestamp) FOR ORDER BY pg_catalog.float_ops,
148+
OPERATOR 20 <=> (timestamp,timestamp) FOR ORDER BY pg_catalog.float_ops,
149+
OPERATOR 21 <=| (timestamp,timestamp) FOR ORDER BY pg_catalog.float_ops,
150+
OPERATOR 22 |=> (timestamp,timestamp) FOR ORDER BY pg_catalog.float_ops,
151151
STORAGE timestamp;
152152

153153
--together

sql/orderby.sql

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ SELECT count(*) FROM tsts WHERE t @@ '(eq|yt)&(wr|qh)';
2020
SET enable_indexscan=OFF;
2121
SET enable_indexonlyscan=OFF;
2222
SET enable_bitmapscan=OFF;
23-
SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-> '2016-05-16 14:21:25' LIMIT 5;
24-
SELECT id, d, d <-| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-| '2016-05-16 14:21:25' LIMIT 5;
25-
SELECT id, d, d |-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |-> '2016-05-16 14:21:25' LIMIT 5;
23+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
24+
SELECT id, d, d <=| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5;
25+
SELECT id, d, d |=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5;
2626

2727

2828
RESET enable_indexscan;
@@ -40,15 +40,15 @@ SELECT count(*) FROM tsts WHERE t @@ '(eq&yt)|(wr&qh)';
4040
SELECT count(*) FROM tsts WHERE t @@ '(eq|yt)&(wr|qh)';
4141

4242
EXPLAIN (costs off)
43-
SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-> '2016-05-16 14:21:25' LIMIT 5;
44-
SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-> '2016-05-16 14:21:25' LIMIT 5;
43+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
44+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
4545
EXPLAIN (costs off)
46-
SELECT id, d, d <-| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-| '2016-05-16 14:21:25' LIMIT 5;
47-
SELECT id, d, d <-| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <-| '2016-05-16 14:21:25' LIMIT 5;
46+
SELECT id, d, d <=| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5;
47+
SELECT id, d, d <=| '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=| '2016-05-16 14:21:25' LIMIT 5;
4848
EXPLAIN (costs off)
49-
SELECT id, d, d |-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |-> '2016-05-16 14:21:25' LIMIT 5;
50-
SELECT id, d, d |-> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |-> '2016-05-16 14:21:25' LIMIT 5;
49+
SELECT id, d, d |=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5;
50+
SELECT id, d, d |=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d |=> '2016-05-16 14:21:25' LIMIT 5;
5151

5252
EXPLAIN (costs off)
53-
SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts ORDER BY d <-> '2016-05-16 14:21:25' LIMIT 5;
54-
SELECT id, d, d <-> '2016-05-16 14:21:25' FROM tsts ORDER BY d <-> '2016-05-16 14:21:25' LIMIT 5;
53+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
54+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;

sql/rum.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ explain (costs off)
1616
SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english', 'ever|wrote');
1717
explain (costs off)
1818
SELECT * FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english', 'ever|wrote')
19-
ORDER BY a <-> to_tsquery('pg_catalog.english', 'ever|wrote');
19+
ORDER BY a <=> to_tsquery('pg_catalog.english', 'ever|wrote');
2020
explain (costs off)
2121
SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english',
2222
'def <-> fgr');
@@ -34,17 +34,17 @@ SELECT count(*) FROM test_rum WHERE a @@ to_tsquery('pg_catalog.english',
3434
SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way')), *
3535
FROM test_rum
3636
WHERE a @@ to_tsquery('pg_catalog.english', 'way')
37-
ORDER BY a <-> to_tsquery('pg_catalog.english', 'way');
37+
ORDER BY a <=> to_tsquery('pg_catalog.english', 'way');
3838
SELECT rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')), *
3939
FROM test_rum
4040
WHERE a @@ to_tsquery('pg_catalog.english', 'way & (go | half)')
41-
ORDER BY a <-> to_tsquery('pg_catalog.english', 'way & (go | half)');
41+
ORDER BY a <=> to_tsquery('pg_catalog.english', 'way & (go | half)');
4242
SELECT
43-
a <-> to_tsquery('pg_catalog.english', 'way & (go | half)'),
43+
a <=> to_tsquery('pg_catalog.english', 'way & (go | half)'),
4444
rum_ts_distance(a, to_tsquery('pg_catalog.english', 'way & (go | half)')),
4545
*
4646
FROM test_rum
47-
ORDER BY a <-> to_tsquery('pg_catalog.english', 'way & (go | half)') limit 2;
47+
ORDER BY a <=> to_tsquery('pg_catalog.english', 'way & (go | half)') limit 2;
4848

4949
INSERT INTO test_rum (t) VALUES ('foo bar foo the over foo qq bar');
5050
INSERT INTO test_rum (t) VALUES ('345 qwerty copyright');

sql/timestamp.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ INSERT INTO test_timestamp VALUES
1212
( '2004-10-26 10:55:08' )
1313
;
1414

15-
SELECT i <-> '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
16-
SELECT i <-| '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
17-
SELECT i |-> '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
15+
SELECT i <=> '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
16+
SELECT i <=| '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
17+
SELECT i |=> '2004-10-26 06:24:08', i FROM test_timestamp ORDER BY 1, 2 ASC;
1818

1919
CREATE INDEX idx_timestamp ON test_timestamp USING rum (i);
2020

0 commit comments

Comments
 (0)