Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit381e4a1

Browse files
author
Artur Zakirov
committed
float8 for new operators
1 parent5103eed commit381e4a1

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

‎contrib/pg_trgm/expected/pg_subword_trgm.out

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ select t,subword_similarity('Kabankala',t) as sml from test_trgm2 where t %> 'Ka
6969
(4 rows)
7070

7171
select t <->> 'Kabankala', t from test_trgm2 order by t <->> 'Kabankala' limit 7;
72-
?column? | t
73-
----------+----------------------------------
74-
0 | Kabankala
75-
0.1 | Kabankalan City Public Plaza
76-
0.3 | Abankala
77-
0.4 | Ntombankala School
78-
0.416667 | Kabakala
79-
0.5 | Nehalla Bankalah Reserved Forest
80-
0.538462 | Kabikala
72+
?column? | t
73+
-------------------+----------------------------------
74+
0 | Kabankala
75+
0.100000023841858 | Kabankalan City Public Plaza
76+
0.300000011920929 | Abankala
77+
0.399999976158142 | Ntombankala School
78+
0.416666686534882 | Kabakala
79+
0.5 | Nehalla Bankalah Reserved Forest
80+
0.538461536169052 | Kabikala
8181
(7 rows)
8282

8383
create index trgm_idx2 on test_trgm2 using gist (t gist_trgm_ops);
@@ -160,15 +160,15 @@ select t <->> 'Kabankala', t from test_trgm2 order by t <->> 'Kabankala' limit 7
160160
(3 rows)
161161

162162
select t <->> 'Kabankala', t from test_trgm2 order by t <->> 'Kabankala' limit 7;
163-
?column? | t
164-
----------+----------------------------------
165-
0 | Kabankala
166-
0.1 | Kabankalan City Public Plaza
167-
0.3 | Abankala
168-
0.4 | Ntombankala School
169-
0.416667 | Kabakala
170-
0.5 | Nehalla Bankalah Reserved Forest
171-
0.538462 | Kabikala
163+
?column? | t
164+
-------------------+----------------------------------
165+
0 | Kabankala
166+
0.100000023841858 | Kabankalan City Public Plaza
167+
0.300000011920929 | Abankala
168+
0.399999976158142 | Ntombankala School
169+
0.416666686534882 | Kabakala
170+
0.5 | Nehalla Bankalah Reserved Forest
171+
0.538461536169052 | Kabikala
172172
(7 rows)
173173

174174
drop index trgm_idx2;

‎contrib/pg_trgm/pg_trgm--1.1--1.2.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ AS 'MODULE_PATHNAME'
1919
LANGUAGE C STRICT STABLE;-- stable because depends on pg_trgm.subword_limit
2020

2121
CREATEFUNCTIONsubword_similarity_dist_op(text,text)
22-
RETURNSfloat4
22+
RETURNSfloat8
2323
AS'MODULE_PATHNAME'
2424
LANGUAGE C STRICT IMMUTABLE;
2525

2626
CREATEFUNCTIONsubword_similarity_dist_commutator_op(text,text)
27-
RETURNSfloat4
27+
RETURNSfloat8
2828
AS'MODULE_PATHNAME'
2929
LANGUAGE C STRICT IMMUTABLE;
3030

‎contrib/pg_trgm/pg_trgm--1.2.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ CREATE OPERATOR <-> (
8585
);
8686

8787
CREATEFUNCTIONsubword_similarity_dist_op(text,text)
88-
RETURNSfloat4
88+
RETURNSfloat8
8989
AS'MODULE_PATHNAME'
9090
LANGUAGE C STRICT IMMUTABLE;
9191

9292
CREATEFUNCTIONsubword_similarity_dist_commutator_op(text,text)
93-
RETURNSfloat4
93+
RETURNSfloat8
9494
AS'MODULE_PATHNAME'
9595
LANGUAGE C STRICT IMMUTABLE;
9696

‎contrib/pg_trgm/trgm_gist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ gtrgm_distance(PG_FUNCTION_ARGS)
471471
*recheck=strategy==SubwordDistanceStrategyNumber;
472472
if (GIST_LEAF(entry))
473473
{/* all leafs contains orig trgm */
474-
res=1.0-cnt_sml(qtrg,key,*recheck)-0.000001;
474+
res=1.0-cnt_sml(qtrg,key,*recheck);
475475
}
476476
elseif (ISALLTRUE(key))
477477
{/* all leafs contains orig trgm */

‎contrib/pg_trgm/trgm_op.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ subword_similarity_dist_op(PG_FUNCTION_ARGS)
11401140

11411141
PG_FREE_IF_COPY(in1,0);
11421142
PG_FREE_IF_COPY(in2,1);
1143-
PG_RETURN_FLOAT4(1.0-res);
1143+
PG_RETURN_FLOAT8(1.0-res);
11441144
}
11451145

11461146
Datum
@@ -1156,5 +1156,5 @@ subword_similarity_dist_commutator_op(PG_FUNCTION_ARGS)
11561156

11571157
PG_FREE_IF_COPY(in1,0);
11581158
PG_FREE_IF_COPY(in2,1);
1159-
PG_RETURN_FLOAT4(1.0-res);
1159+
PG_RETURN_FLOAT8(1.0-res);
11601160
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp