summaryrefslogtreecommitdiff
path: root/contrib/fuzzystrmatch
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/fuzzystrmatch')
-rw-r--r--contrib/fuzzystrmatch/.gitignore1
-rw-r--r--contrib/fuzzystrmatch/Makefile5
-rw-r--r--contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql (renamed from contrib/fuzzystrmatch/fuzzystrmatch.sql.in)5
-rw-r--r--contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql12
-rw-r--r--contrib/fuzzystrmatch/fuzzystrmatch.control5
-rw-r--r--contrib/fuzzystrmatch/uninstall_fuzzystrmatch.sql24
6 files changed, 21 insertions, 31 deletions
diff --git a/contrib/fuzzystrmatch/.gitignore b/contrib/fuzzystrmatch/.gitignore
deleted file mode 100644
index f4962c630b..0000000000
--- a/contrib/fuzzystrmatch/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/fuzzystrmatch.sql
diff --git a/contrib/fuzzystrmatch/Makefile b/contrib/fuzzystrmatch/Makefile
index 9cdf3f87e3..74728a30b5 100644
--- a/contrib/fuzzystrmatch/Makefile
+++ b/contrib/fuzzystrmatch/Makefile
@@ -2,8 +2,9 @@
MODULE_big = fuzzystrmatch
OBJS = fuzzystrmatch.o dmetaphone.o
-DATA_built = fuzzystrmatch.sql
-DATA = uninstall_fuzzystrmatch.sql
+
+EXTENSION = fuzzystrmatch
+DATA = fuzzystrmatch--1.0.sql fuzzystrmatch--unpackaged--1.0.sql
ifdef USE_PGXS
PG_CONFIG = pg_config
diff --git a/contrib/fuzzystrmatch/fuzzystrmatch.sql.in b/contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql
index 0f2ea85e48..1d27f5c3dd 100644
--- a/contrib/fuzzystrmatch/fuzzystrmatch.sql.in
+++ b/contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql
@@ -1,7 +1,4 @@
-/* contrib/fuzzystrmatch/fuzzystrmatch.sql.in */
-
--- Adjust this setting to control where the objects get created.
-SET search_path = public;
+/* contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql */
CREATE OR REPLACE FUNCTION levenshtein (text,text) RETURNS int
AS 'MODULE_PATHNAME','levenshtein'
diff --git a/contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql b/contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql
new file mode 100644
index 0000000000..12077a84ae
--- /dev/null
+++ b/contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql
@@ -0,0 +1,12 @@
+/* contrib/fuzzystrmatch/fuzzystrmatch--unpackaged--1.0.sql */
+
+ALTER EXTENSION fuzzystrmatch ADD function levenshtein(text,text);
+ALTER EXTENSION fuzzystrmatch ADD function levenshtein(text,text,integer,integer,integer);
+ALTER EXTENSION fuzzystrmatch ADD function levenshtein_less_equal(text,text,integer);
+ALTER EXTENSION fuzzystrmatch ADD function levenshtein_less_equal(text,text,integer,integer,integer,integer);
+ALTER EXTENSION fuzzystrmatch ADD function metaphone(text,integer);
+ALTER EXTENSION fuzzystrmatch ADD function soundex(text);
+ALTER EXTENSION fuzzystrmatch ADD function text_soundex(text);
+ALTER EXTENSION fuzzystrmatch ADD function difference(text,text);
+ALTER EXTENSION fuzzystrmatch ADD function dmetaphone(text);
+ALTER EXTENSION fuzzystrmatch ADD function dmetaphone_alt(text);
diff --git a/contrib/fuzzystrmatch/fuzzystrmatch.control b/contrib/fuzzystrmatch/fuzzystrmatch.control
new file mode 100644
index 0000000000..e257f09611
--- /dev/null
+++ b/contrib/fuzzystrmatch/fuzzystrmatch.control
@@ -0,0 +1,5 @@
+# fuzzystrmatch extension
+comment = 'determine similarities and distance between strings'
+default_version = '1.0'
+module_pathname = '$libdir/fuzzystrmatch'
+relocatable = true
diff --git a/contrib/fuzzystrmatch/uninstall_fuzzystrmatch.sql b/contrib/fuzzystrmatch/uninstall_fuzzystrmatch.sql
deleted file mode 100644
index a39c7bfc94..0000000000
--- a/contrib/fuzzystrmatch/uninstall_fuzzystrmatch.sql
+++ /dev/null
@@ -1,24 +0,0 @@
-/* contrib/fuzzystrmatch/uninstall_fuzzystrmatch.sql */
-
--- Adjust this setting to control where the objects get dropped.
-SET search_path = public;
-
-DROP FUNCTION dmetaphone_alt (text);
-
-DROP FUNCTION dmetaphone (text);
-
-DROP FUNCTION difference(text,text);
-
-DROP FUNCTION text_soundex(text);
-
-DROP FUNCTION soundex(text);
-
-DROP FUNCTION metaphone (text,int);
-
-DROP FUNCTION levenshtein (text,text,int,int,int);
-
-DROP FUNCTION levenshtein (text,text);
-
-DROP FUNCTION levenshtein_less_equal (text,text,int);
-
-DROP FUNCTION levenshtein_less_equal (text,text,int,int,int,int);