diff options
| author | Tom Lane | 2011-02-14 01:06:41 +0000 |
|---|---|---|
| committer | Tom Lane | 2011-02-14 03:54:49 +0000 |
| commit | 629b3af27d5c2bc9d6e16b22b943ad651d4ecb56 (patch) | |
| tree | eae9ef9a69ae6ad7aacb2428e3cf15ec77873ac5 /contrib/dict_xsyn | |
| parent | e693e97d754ed6812ea115170afeae4bf8797d3f (diff) | |
Convert contrib modules to use the extension facility.
This isn't fully tested as yet, in particular I'm not sure that the
"foo--unpackaged--1.0.sql" scripts are OK. But it's time to get some
buildfarm cycles on it.
sepgsql is not converted to an extension, mainly because it seems to
require a very nonstandard installation process.
Dimitri Fontaine and Tom Lane
Diffstat (limited to 'contrib/dict_xsyn')
| -rw-r--r-- | contrib/dict_xsyn/.gitignore | 1 | ||||
| -rw-r--r-- | contrib/dict_xsyn/Makefile | 6 | ||||
| -rw-r--r-- | contrib/dict_xsyn/dict_xsyn--1.0.sql (renamed from contrib/dict_xsyn/dict_xsyn.sql.in) | 5 | ||||
| -rw-r--r-- | contrib/dict_xsyn/dict_xsyn--unpackaged--1.0.sql | 6 | ||||
| -rw-r--r-- | contrib/dict_xsyn/dict_xsyn.control | 5 | ||||
| -rw-r--r-- | contrib/dict_xsyn/expected/dict_xsyn.out | 8 | ||||
| -rw-r--r-- | contrib/dict_xsyn/sql/dict_xsyn.sql | 10 | ||||
| -rw-r--r-- | contrib/dict_xsyn/uninstall_dict_xsyn.sql | 12 |
8 files changed, 18 insertions, 35 deletions
diff --git a/contrib/dict_xsyn/.gitignore b/contrib/dict_xsyn/.gitignore index 0ebd61caaff..19b6c5ba425 100644 --- a/contrib/dict_xsyn/.gitignore +++ b/contrib/dict_xsyn/.gitignore @@ -1,3 +1,2 @@ -/dict_xsyn.sql # Generated subdirectories /results/ diff --git a/contrib/dict_xsyn/Makefile b/contrib/dict_xsyn/Makefile index 8b737f09fcc..ce92baa4789 100644 --- a/contrib/dict_xsyn/Makefile +++ b/contrib/dict_xsyn/Makefile @@ -2,9 +2,11 @@ MODULE_big = dict_xsyn OBJS = dict_xsyn.o -DATA_built = dict_xsyn.sql -DATA = uninstall_dict_xsyn.sql + +EXTENSION = dict_xsyn +DATA = dict_xsyn--1.0.sql dict_xsyn--unpackaged--1.0.sql DATA_TSEARCH = xsyn_sample.rules + REGRESS = dict_xsyn ifdef USE_PGXS diff --git a/contrib/dict_xsyn/dict_xsyn.sql.in b/contrib/dict_xsyn/dict_xsyn--1.0.sql index 7d48c9209f5..0b6a21730fd 100644 --- a/contrib/dict_xsyn/dict_xsyn.sql.in +++ b/contrib/dict_xsyn/dict_xsyn--1.0.sql @@ -1,7 +1,4 @@ -/* contrib/dict_xsyn/dict_xsyn.sql.in */ - --- Adjust this setting to control where the objects get created. -SET search_path = public; +/* contrib/dict_xsyn/dict_xsyn--1.0.sql */ CREATE OR REPLACE FUNCTION dxsyn_init(internal) RETURNS internal diff --git a/contrib/dict_xsyn/dict_xsyn--unpackaged--1.0.sql b/contrib/dict_xsyn/dict_xsyn--unpackaged--1.0.sql new file mode 100644 index 00000000000..6fe0285f799 --- /dev/null +++ b/contrib/dict_xsyn/dict_xsyn--unpackaged--1.0.sql @@ -0,0 +1,6 @@ +/* contrib/dict_xsyn/dict_xsyn--unpackaged--1.0.sql */ + +ALTER EXTENSION dict_xsyn ADD function dxsyn_init(internal); +ALTER EXTENSION dict_xsyn ADD function dxsyn_lexize(internal,internal,internal,internal); +ALTER EXTENSION dict_xsyn ADD text search template xsyn_template; +ALTER EXTENSION dict_xsyn ADD text search dictionary xsyn; diff --git a/contrib/dict_xsyn/dict_xsyn.control b/contrib/dict_xsyn/dict_xsyn.control new file mode 100644 index 00000000000..3fd465a9557 --- /dev/null +++ b/contrib/dict_xsyn/dict_xsyn.control @@ -0,0 +1,5 @@ +# dict_xsyn extension +comment = 'text search dictionary template for extended synonym processing' +default_version = '1.0' +module_pathname = '$libdir/dict_xsyn' +relocatable = true diff --git a/contrib/dict_xsyn/expected/dict_xsyn.out b/contrib/dict_xsyn/expected/dict_xsyn.out index d91697a97e9..9b95e135591 100644 --- a/contrib/dict_xsyn/expected/dict_xsyn.out +++ b/contrib/dict_xsyn/expected/dict_xsyn.out @@ -1,10 +1,4 @@ --- --- first, define the datatype. Turn off echoing so that expected file --- does not depend on contents of this file. --- -SET client_min_messages = warning; -\set ECHO none -RESET client_min_messages; +CREATE EXTENSION dict_xsyn; -- default configuration - match first word and return it among with all synonyms ALTER TEXT SEARCH DICTIONARY xsyn (RULES='xsyn_sample', KEEPORIG=true, MATCHORIG=true, KEEPSYNONYMS=true, MATCHSYNONYMS=false); --lexize diff --git a/contrib/dict_xsyn/sql/dict_xsyn.sql b/contrib/dict_xsyn/sql/dict_xsyn.sql index 9db0851700c..49511061d0c 100644 --- a/contrib/dict_xsyn/sql/dict_xsyn.sql +++ b/contrib/dict_xsyn/sql/dict_xsyn.sql @@ -1,12 +1,4 @@ --- --- first, define the datatype. Turn off echoing so that expected file --- does not depend on contents of this file. --- -SET client_min_messages = warning; -\set ECHO none -\i dict_xsyn.sql -\set ECHO all -RESET client_min_messages; +CREATE EXTENSION dict_xsyn; -- default configuration - match first word and return it among with all synonyms ALTER TEXT SEARCH DICTIONARY xsyn (RULES='xsyn_sample', KEEPORIG=true, MATCHORIG=true, KEEPSYNONYMS=true, MATCHSYNONYMS=false); diff --git a/contrib/dict_xsyn/uninstall_dict_xsyn.sql b/contrib/dict_xsyn/uninstall_dict_xsyn.sql deleted file mode 100644 index 68f9579c056..00000000000 --- a/contrib/dict_xsyn/uninstall_dict_xsyn.sql +++ /dev/null @@ -1,12 +0,0 @@ -/* contrib/dict_xsyn/uninstall_dict_xsyn.sql */ - --- Adjust this setting to control where the objects get dropped. -SET search_path = public; - -DROP TEXT SEARCH DICTIONARY xsyn; - -DROP TEXT SEARCH TEMPLATE xsyn_template; - -DROP FUNCTION dxsyn_init(internal); - -DROP FUNCTION dxsyn_lexize(internal,internal,internal,internal); |
