Update fuzzystrmatch extension for parallel query.

All functions provided by this extension are PARALLEL SAFE.

Andreas Karlsson
This commit is contained in:
Robert Haas 2016-06-07 11:25:53 -04:00
parent 50e5226bb3
commit ffab82fbda
4 changed files with 29 additions and 13 deletions

View File

@ -4,7 +4,8 @@ MODULE_big = fuzzystrmatch
OBJS = fuzzystrmatch.o dmetaphone.o $(WIN32RES)
EXTENSION = fuzzystrmatch
DATA = fuzzystrmatch--1.0.sql fuzzystrmatch--unpackaged--1.0.sql
DATA = fuzzystrmatch--1.1.sql fuzzystrmatch--1.0--1.1.sql \
fuzzystrmatch--unpackaged--1.0.sql
PGFILEDESC = "fuzzystrmatch - similarities and distance between strings"
ifdef USE_PGXS

View File

@ -0,0 +1,15 @@
/* contrib/fuzzystrmatch/fuzzystrmatch--1.0--1.1.sql */
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION fuzzystrmatch UPDATE TO '1.1'" to load this file. \quit
ALTER FUNCTION levenshtein(text, text) PARALLEL SAFE;
ALTER FUNCTION levenshtein(text, text, int, int, int) PARALLEL SAFE;
ALTER FUNCTION levenshtein_less_equal(text, text, int) PARALLEL SAFE;
ALTER FUNCTION levenshtein_less_equal(text, text, int, int, int, int) PARALLEL SAFE;
ALTER FUNCTION metaphone(text, int) PARALLEL SAFE;
ALTER FUNCTION soundex(text) PARALLEL SAFE;
ALTER FUNCTION text_soundex(text) PARALLEL SAFE;
ALTER FUNCTION difference(text, text) PARALLEL SAFE;
ALTER FUNCTION dmetaphone(text) PARALLEL SAFE;
ALTER FUNCTION dmetaphone_alt(text) PARALLEL SAFE;

View File

@ -1,44 +1,44 @@
/* contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql */
/* contrib/fuzzystrmatch/fuzzystrmatch--1.1.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION fuzzystrmatch" to load this file. \quit
CREATE FUNCTION levenshtein (text,text) RETURNS int
AS 'MODULE_PATHNAME','levenshtein'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION levenshtein (text,text,int,int,int) RETURNS int
AS 'MODULE_PATHNAME','levenshtein_with_costs'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION levenshtein_less_equal (text,text,int) RETURNS int
AS 'MODULE_PATHNAME','levenshtein_less_equal'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION levenshtein_less_equal (text,text,int,int,int,int) RETURNS int
AS 'MODULE_PATHNAME','levenshtein_less_equal_with_costs'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION metaphone (text,int) RETURNS text
AS 'MODULE_PATHNAME','metaphone'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION soundex(text) RETURNS text
AS 'MODULE_PATHNAME', 'soundex'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION text_soundex(text) RETURNS text
AS 'MODULE_PATHNAME', 'soundex'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION difference(text,text) RETURNS int
AS 'MODULE_PATHNAME', 'difference'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION dmetaphone (text) RETURNS text
AS 'MODULE_PATHNAME', 'dmetaphone'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION dmetaphone_alt (text) RETURNS text
AS 'MODULE_PATHNAME', 'dmetaphone_alt'
LANGUAGE C IMMUTABLE STRICT;
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

View File

@ -1,5 +1,5 @@
# fuzzystrmatch extension
comment = 'determine similarities and distance between strings'
default_version = '1.0'
default_version = '1.1'
module_pathname = '$libdir/fuzzystrmatch'
relocatable = true