summaryrefslogtreecommitdiff
path: root/contrib/ltree
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ltree')
-rw-r--r--contrib/ltree/.gitignore1
-rw-r--r--contrib/ltree/Makefile8
-rw-r--r--contrib/ltree/expected/ltree.out8
-rw-r--r--contrib/ltree/ltree--1.0.sql (renamed from contrib/ltree/ltree.sql.in)5
-rw-r--r--contrib/ltree/ltree--unpackaged--1.0.sql131
-rw-r--r--contrib/ltree/ltree.control5
-rw-r--r--contrib/ltree/sql/ltree.sql10
-rw-r--r--contrib/ltree/uninstall_ltree.sql240
8 files changed, 144 insertions, 264 deletions
diff --git a/contrib/ltree/.gitignore b/contrib/ltree/.gitignore
index 49883e82a3..19b6c5ba42 100644
--- a/contrib/ltree/.gitignore
+++ b/contrib/ltree/.gitignore
@@ -1,3 +1,2 @@
-/ltree.sql
# Generated subdirectories
/results/
diff --git a/contrib/ltree/Makefile b/contrib/ltree/Makefile
index bad3cbfe85..65d42f875f 100644
--- a/contrib/ltree/Makefile
+++ b/contrib/ltree/Makefile
@@ -1,11 +1,13 @@
# contrib/ltree/Makefile
-PG_CPPFLAGS = -DLOWER_NODE
MODULE_big = ltree
OBJS = ltree_io.o ltree_op.o lquery_op.o _ltree_op.o crc32.o \
ltxtquery_io.o ltxtquery_op.o ltree_gist.o _ltree_gist.o
-DATA_built = ltree.sql
-DATA = uninstall_ltree.sql
+PG_CPPFLAGS = -DLOWER_NODE
+
+EXTENSION = ltree
+DATA = ltree--1.0.sql ltree--unpackaged--1.0.sql
+
REGRESS = ltree
ifdef USE_PGXS
diff --git a/contrib/ltree/expected/ltree.out b/contrib/ltree/expected/ltree.out
index 7f61e569cf..da6e39a785 100644
--- a/contrib/ltree/expected/ltree.out
+++ b/contrib/ltree/expected/ltree.out
@@ -1,10 +1,4 @@
---
--- first, define the datatype. Turn off echoing so that expected file
--- does not depend on contents of ltree.sql.
---
-SET client_min_messages = warning;
-\set ECHO none
-RESET client_min_messages;
+CREATE EXTENSION ltree;
SELECT ''::ltree;
ltree
-------
diff --git a/contrib/ltree/ltree.sql.in b/contrib/ltree/ltree--1.0.sql
index 1b985a7a99..d9b5ead53a 100644
--- a/contrib/ltree/ltree.sql.in
+++ b/contrib/ltree/ltree--1.0.sql
@@ -1,7 +1,4 @@
-/* contrib/ltree/ltree.sql.in */
-
--- Adjust this setting to control where the objects get created.
-SET search_path = public;
+/* contrib/ltree/ltree--1.0.sql */
CREATE OR REPLACE FUNCTION ltree_in(cstring)
RETURNS ltree
diff --git a/contrib/ltree/ltree--unpackaged--1.0.sql b/contrib/ltree/ltree--unpackaged--1.0.sql
new file mode 100644
index 0000000000..f483725b4a
--- /dev/null
+++ b/contrib/ltree/ltree--unpackaged--1.0.sql
@@ -0,0 +1,131 @@
+/* contrib/ltree/ltree--unpackaged--1.0.sql */
+
+ALTER EXTENSION ltree ADD type ltree;
+ALTER EXTENSION ltree ADD function ltree_in(cstring);
+ALTER EXTENSION ltree ADD function ltree_out(ltree);
+ALTER EXTENSION ltree ADD function ltree_cmp(ltree,ltree);
+ALTER EXTENSION ltree ADD function ltree_lt(ltree,ltree);
+ALTER EXTENSION ltree ADD function ltree_le(ltree,ltree);
+ALTER EXTENSION ltree ADD function ltree_eq(ltree,ltree);
+ALTER EXTENSION ltree ADD function ltree_ge(ltree,ltree);
+ALTER EXTENSION ltree ADD function ltree_gt(ltree,ltree);
+ALTER EXTENSION ltree ADD function ltree_ne(ltree,ltree);
+ALTER EXTENSION ltree ADD operator >(ltree,ltree);
+ALTER EXTENSION ltree ADD operator >=(ltree,ltree);
+ALTER EXTENSION ltree ADD operator <(ltree,ltree);
+ALTER EXTENSION ltree ADD operator <=(ltree,ltree);
+ALTER EXTENSION ltree ADD operator <>(ltree,ltree);
+ALTER EXTENSION ltree ADD operator =(ltree,ltree);
+ALTER EXTENSION ltree ADD function subltree(ltree,integer,integer);
+ALTER EXTENSION ltree ADD function subpath(ltree,integer,integer);
+ALTER EXTENSION ltree ADD function subpath(ltree,integer);
+ALTER EXTENSION ltree ADD function index(ltree,ltree);
+ALTER EXTENSION ltree ADD function index(ltree,ltree,integer);
+ALTER EXTENSION ltree ADD function nlevel(ltree);
+ALTER EXTENSION ltree ADD function ltree2text(ltree);
+ALTER EXTENSION ltree ADD function text2ltree(text);
+ALTER EXTENSION ltree ADD function lca(ltree[]);
+ALTER EXTENSION ltree ADD function lca(ltree,ltree);
+ALTER EXTENSION ltree ADD function lca(ltree,ltree,ltree);
+ALTER EXTENSION ltree ADD function lca(ltree,ltree,ltree,ltree);
+ALTER EXTENSION ltree ADD function lca(ltree,ltree,ltree,ltree,ltree);
+ALTER EXTENSION ltree ADD function lca(ltree,ltree,ltree,ltree,ltree,ltree);
+ALTER EXTENSION ltree ADD function lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree);
+ALTER EXTENSION ltree ADD function lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree,ltree);
+ALTER EXTENSION ltree ADD function ltree_isparent(ltree,ltree);
+ALTER EXTENSION ltree ADD function ltree_risparent(ltree,ltree);
+ALTER EXTENSION ltree ADD function ltree_addltree(ltree,ltree);
+ALTER EXTENSION ltree ADD function ltree_addtext(ltree,text);
+ALTER EXTENSION ltree ADD function ltree_textadd(text,ltree);
+ALTER EXTENSION ltree ADD function ltreeparentsel(internal,oid,internal,integer);
+ALTER EXTENSION ltree ADD operator <@(ltree,ltree);
+ALTER EXTENSION ltree ADD operator @>(ltree,ltree);
+ALTER EXTENSION ltree ADD operator ^<@(ltree,ltree);
+ALTER EXTENSION ltree ADD operator ^@>(ltree,ltree);
+ALTER EXTENSION ltree ADD operator ||(ltree,ltree);
+ALTER EXTENSION ltree ADD operator ||(ltree,text);
+ALTER EXTENSION ltree ADD operator ||(text,ltree);
+ALTER EXTENSION ltree ADD operator family ltree_ops using btree;
+ALTER EXTENSION ltree ADD operator class ltree_ops using btree;
+ALTER EXTENSION ltree ADD type lquery;
+ALTER EXTENSION ltree ADD function lquery_in(cstring);
+ALTER EXTENSION ltree ADD function lquery_out(lquery);
+ALTER EXTENSION ltree ADD function ltq_regex(ltree,lquery);
+ALTER EXTENSION ltree ADD function ltq_rregex(lquery,ltree);
+ALTER EXTENSION ltree ADD operator ~(lquery,ltree);
+ALTER EXTENSION ltree ADD operator ~(ltree,lquery);
+ALTER EXTENSION ltree ADD operator ^~(lquery,ltree);
+ALTER EXTENSION ltree ADD operator ^~(ltree,lquery);
+ALTER EXTENSION ltree ADD function lt_q_regex(ltree,lquery[]);
+ALTER EXTENSION ltree ADD function lt_q_rregex(lquery[],ltree);
+ALTER EXTENSION ltree ADD operator ?(lquery[],ltree);
+ALTER EXTENSION ltree ADD operator ?(ltree,lquery[]);
+ALTER EXTENSION ltree ADD operator ^?(lquery[],ltree);
+ALTER EXTENSION ltree ADD operator ^?(ltree,lquery[]);
+ALTER EXTENSION ltree ADD type ltxtquery;
+ALTER EXTENSION ltree ADD function ltxtq_in(cstring);
+ALTER EXTENSION ltree ADD function ltxtq_out(ltxtquery);
+ALTER EXTENSION ltree ADD function ltxtq_exec(ltree,ltxtquery);
+ALTER EXTENSION ltree ADD function ltxtq_rexec(ltxtquery,ltree);
+ALTER EXTENSION ltree ADD operator @(ltxtquery,ltree);
+ALTER EXTENSION ltree ADD operator @(ltree,ltxtquery);
+ALTER EXTENSION ltree ADD operator ^@(ltxtquery,ltree);
+ALTER EXTENSION ltree ADD operator ^@(ltree,ltxtquery);
+ALTER EXTENSION ltree ADD type ltree_gist;
+ALTER EXTENSION ltree ADD function ltree_gist_in(cstring);
+ALTER EXTENSION ltree ADD function ltree_gist_out(ltree_gist);
+ALTER EXTENSION ltree ADD function ltree_consistent(internal,internal,smallint,oid,internal);
+ALTER EXTENSION ltree ADD function ltree_compress(internal);
+ALTER EXTENSION ltree ADD function ltree_decompress(internal);
+ALTER EXTENSION ltree ADD function ltree_penalty(internal,internal,internal);
+ALTER EXTENSION ltree ADD function ltree_picksplit(internal,internal);
+ALTER EXTENSION ltree ADD function ltree_union(internal,internal);
+ALTER EXTENSION ltree ADD function ltree_same(internal,internal,internal);
+ALTER EXTENSION ltree ADD operator family gist_ltree_ops using gist;
+ALTER EXTENSION ltree ADD operator class gist_ltree_ops using gist;
+ALTER EXTENSION ltree ADD function _ltree_isparent(ltree[],ltree);
+ALTER EXTENSION ltree ADD function _ltree_r_isparent(ltree,ltree[]);
+ALTER EXTENSION ltree ADD function _ltree_risparent(ltree[],ltree);
+ALTER EXTENSION ltree ADD function _ltree_r_risparent(ltree,ltree[]);
+ALTER EXTENSION ltree ADD function _ltq_regex(ltree[],lquery);
+ALTER EXTENSION ltree ADD function _ltq_rregex(lquery,ltree[]);
+ALTER EXTENSION ltree ADD function _lt_q_regex(ltree[],lquery[]);
+ALTER EXTENSION ltree ADD function _lt_q_rregex(lquery[],ltree[]);
+ALTER EXTENSION ltree ADD function _ltxtq_exec(ltree[],ltxtquery);
+ALTER EXTENSION ltree ADD function _ltxtq_rexec(ltxtquery,ltree[]);
+ALTER EXTENSION ltree ADD operator <@(ltree,ltree[]);
+ALTER EXTENSION ltree ADD operator @>(ltree[],ltree);
+ALTER EXTENSION ltree ADD operator @>(ltree,ltree[]);
+ALTER EXTENSION ltree ADD operator <@(ltree[],ltree);
+ALTER EXTENSION ltree ADD operator ~(lquery,ltree[]);
+ALTER EXTENSION ltree ADD operator ~(ltree[],lquery);
+ALTER EXTENSION ltree ADD operator ?(lquery[],ltree[]);
+ALTER EXTENSION ltree ADD operator ?(ltree[],lquery[]);
+ALTER EXTENSION ltree ADD operator @(ltxtquery,ltree[]);
+ALTER EXTENSION ltree ADD operator @(ltree[],ltxtquery);
+ALTER EXTENSION ltree ADD operator ^<@(ltree,ltree[]);
+ALTER EXTENSION ltree ADD operator ^@>(ltree[],ltree);
+ALTER EXTENSION ltree ADD operator ^@>(ltree,ltree[]);
+ALTER EXTENSION ltree ADD operator ^<@(ltree[],ltree);
+ALTER EXTENSION ltree ADD operator ^~(lquery,ltree[]);
+ALTER EXTENSION ltree ADD operator ^~(ltree[],lquery);
+ALTER EXTENSION ltree ADD operator ^?(lquery[],ltree[]);
+ALTER EXTENSION ltree ADD operator ^?(ltree[],lquery[]);
+ALTER EXTENSION ltree ADD operator ^@(ltxtquery,ltree[]);
+ALTER EXTENSION ltree ADD operator ^@(ltree[],ltxtquery);
+ALTER EXTENSION ltree ADD function _ltree_extract_isparent(ltree[],ltree);
+ALTER EXTENSION ltree ADD operator ?@>(ltree[],ltree);
+ALTER EXTENSION ltree ADD function _ltree_extract_risparent(ltree[],ltree);
+ALTER EXTENSION ltree ADD operator ?<@(ltree[],ltree);
+ALTER EXTENSION ltree ADD function _ltq_extract_regex(ltree[],lquery);
+ALTER EXTENSION ltree ADD operator ?~(ltree[],lquery);
+ALTER EXTENSION ltree ADD function _ltxtq_extract_exec(ltree[],ltxtquery);
+ALTER EXTENSION ltree ADD operator ?@(ltree[],ltxtquery);
+ALTER EXTENSION ltree ADD function _ltree_consistent(internal,internal,smallint,oid,internal);
+ALTER EXTENSION ltree ADD function _ltree_compress(internal);
+ALTER EXTENSION ltree ADD function _ltree_penalty(internal,internal,internal);
+ALTER EXTENSION ltree ADD function _ltree_picksplit(internal,internal);
+ALTER EXTENSION ltree ADD function _ltree_union(internal,internal);
+ALTER EXTENSION ltree ADD function _ltree_same(internal,internal,internal);
+ALTER EXTENSION ltree ADD operator family gist__ltree_ops using gist;
+ALTER EXTENSION ltree ADD operator class gist__ltree_ops using gist;
diff --git a/contrib/ltree/ltree.control b/contrib/ltree/ltree.control
new file mode 100644
index 0000000000..d879fd618c
--- /dev/null
+++ b/contrib/ltree/ltree.control
@@ -0,0 +1,5 @@
+# ltree extension
+comment = 'data type for hierarchical tree-like structures'
+default_version = '1.0'
+module_pathname = '$libdir/ltree'
+relocatable = true
diff --git a/contrib/ltree/sql/ltree.sql b/contrib/ltree/sql/ltree.sql
index 50aad78d3c..46cfa41a41 100644
--- a/contrib/ltree/sql/ltree.sql
+++ b/contrib/ltree/sql/ltree.sql
@@ -1,12 +1,4 @@
---
--- first, define the datatype. Turn off echoing so that expected file
--- does not depend on contents of ltree.sql.
---
-SET client_min_messages = warning;
-\set ECHO none
-\i ltree.sql
-\set ECHO all
-RESET client_min_messages;
+CREATE EXTENSION ltree;
SELECT ''::ltree;
SELECT '1'::ltree;
diff --git a/contrib/ltree/uninstall_ltree.sql b/contrib/ltree/uninstall_ltree.sql
deleted file mode 100644
index 2e10b10e97..0000000000
--- a/contrib/ltree/uninstall_ltree.sql
+++ /dev/null
@@ -1,240 +0,0 @@
-/* contrib/ltree/uninstall_ltree.sql */
-
--- Adjust this setting to control where the objects get dropped.
-SET search_path = public;
-
-DROP OPERATOR CLASS gist__ltree_ops USING gist;
-
-DROP FUNCTION _ltree_same(internal, internal, internal);
-
-DROP FUNCTION _ltree_union(internal, internal);
-
-DROP FUNCTION _ltree_picksplit(internal, internal);
-
-DROP FUNCTION _ltree_penalty(internal,internal,internal);
-
-DROP FUNCTION _ltree_compress(internal);
-
-DROP FUNCTION _ltree_consistent(internal,internal,int2,oid,internal);
-
-DROP OPERATOR ?@ (_ltree, ltxtquery);
-
-DROP FUNCTION _ltxtq_extract_exec(_ltree,ltxtquery);
-
-DROP OPERATOR ?~ (_ltree, lquery);
-
-DROP FUNCTION _ltq_extract_regex(_ltree,lquery);
-
-DROP OPERATOR ?<@ (_ltree, ltree);
-
-DROP FUNCTION _ltree_extract_risparent(_ltree,ltree);
-
-DROP OPERATOR ?@> (_ltree, ltree);
-
-DROP FUNCTION _ltree_extract_isparent(_ltree,ltree);
-
-DROP OPERATOR ^@ (ltxtquery, _ltree);
-
-DROP OPERATOR ^@ (_ltree, ltxtquery);
-
-DROP OPERATOR ^? (_lquery, _ltree);
-
-DROP OPERATOR ^? (_ltree, _lquery);
-
-DROP OPERATOR ^~ (lquery, _ltree);
-
-DROP OPERATOR ^~ (_ltree, lquery);
-
-DROP OPERATOR ^@> (ltree, _ltree);
-
-DROP OPERATOR ^<@ (_ltree, ltree);
-
-DROP OPERATOR ^<@ (ltree, _ltree);
-
-DROP OPERATOR ^@> (_ltree, ltree);
-
-DROP OPERATOR @ (ltxtquery, _ltree);
-
-DROP OPERATOR @ (_ltree, ltxtquery);
-
-DROP OPERATOR ? (_lquery, _ltree);
-
-DROP OPERATOR ? (_ltree, _lquery);
-
-DROP OPERATOR ~ (lquery, _ltree);
-
-DROP OPERATOR ~ (_ltree, lquery);
-
-DROP OPERATOR @> (ltree, _ltree);
-
-DROP OPERATOR <@ (_ltree, ltree);
-
-DROP OPERATOR <@ (ltree, _ltree);
-
-DROP OPERATOR @> (_ltree, ltree);
-
-DROP FUNCTION _ltxtq_rexec(ltxtquery, _ltree);
-
-DROP FUNCTION _ltxtq_exec(_ltree, ltxtquery);
-
-DROP FUNCTION _lt_q_rregex(_lquery,_ltree);
-
-DROP FUNCTION _lt_q_regex(_ltree,_lquery);
-
-DROP FUNCTION _ltq_rregex(lquery,_ltree);
-
-DROP FUNCTION _ltq_regex(_ltree,lquery);
-
-DROP FUNCTION _ltree_r_risparent(ltree,_ltree);
-
-DROP FUNCTION _ltree_risparent(_ltree,ltree);
-
-DROP FUNCTION _ltree_r_isparent(ltree,_ltree);
-
-DROP FUNCTION _ltree_isparent(_ltree,ltree);
-
-DROP OPERATOR CLASS gist_ltree_ops USING gist;
-
-DROP FUNCTION ltree_same(internal, internal, internal);
-
-DROP FUNCTION ltree_union(internal, internal);
-
-DROP FUNCTION ltree_picksplit(internal, internal);
-
-DROP FUNCTION ltree_penalty(internal,internal,internal);
-
-DROP FUNCTION ltree_decompress(internal);
-
-DROP FUNCTION ltree_compress(internal);
-
-DROP FUNCTION ltree_consistent(internal,internal,int2,oid,internal);
-
-DROP TYPE ltree_gist CASCADE;
-
-DROP OPERATOR ^@ (ltxtquery, ltree);
-
-DROP OPERATOR ^@ (ltree, ltxtquery);
-
-DROP OPERATOR @ (ltxtquery, ltree);
-
-DROP OPERATOR @ (ltree, ltxtquery);
-
-DROP FUNCTION ltxtq_rexec(ltxtquery, ltree);
-
-DROP FUNCTION ltxtq_exec(ltree, ltxtquery);
-
-DROP TYPE ltxtquery CASCADE;
-
-DROP OPERATOR ^? (_lquery, ltree);
-
-DROP OPERATOR ^? (ltree, _lquery);
-
-DROP OPERATOR ? (_lquery, ltree);
-
-DROP OPERATOR ? (ltree, _lquery);
-
-DROP FUNCTION lt_q_rregex(_lquery,ltree);
-
-DROP FUNCTION lt_q_regex(ltree,_lquery);
-
-DROP OPERATOR ^~ (lquery, ltree);
-
-DROP OPERATOR ^~ (ltree, lquery);
-
-DROP OPERATOR ~ (lquery, ltree);
-
-DROP OPERATOR ~ (ltree, lquery);
-
-DROP FUNCTION ltq_rregex(lquery,ltree);
-
-DROP FUNCTION ltq_regex(ltree,lquery);
-
-DROP TYPE lquery CASCADE;
-
-DROP OPERATOR CLASS ltree_ops USING btree;
-
-DROP OPERATOR || (text, ltree);
-
-DROP OPERATOR || (ltree, text);
-
-DROP OPERATOR || (ltree, ltree);
-
-DROP OPERATOR ^<@ (ltree, ltree);
-
-DROP OPERATOR <@ (ltree, ltree);
-
-DROP OPERATOR ^@> (ltree, ltree);
-
-DROP OPERATOR @> (ltree, ltree);
-
-DROP FUNCTION ltreeparentsel(internal, oid, internal, integer);
-
-DROP FUNCTION ltree_textadd(text,ltree);
-
-DROP FUNCTION ltree_addtext(ltree,text);
-
-DROP FUNCTION ltree_addltree(ltree,ltree);
-
-DROP FUNCTION ltree_risparent(ltree,ltree);
-
-DROP FUNCTION ltree_isparent(ltree,ltree);
-
-DROP FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree,ltree);
-
-DROP FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree);
-
-DROP FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree);
-
-DROP FUNCTION lca(ltree,ltree,ltree,ltree,ltree);
-
-DROP FUNCTION lca(ltree,ltree,ltree,ltree);
-
-DROP FUNCTION lca(ltree,ltree,ltree);
-
-DROP FUNCTION lca(ltree,ltree);
-
-DROP FUNCTION lca(_ltree);
-
-DROP FUNCTION text2ltree(text);
-
-DROP FUNCTION ltree2text(ltree);
-
-DROP FUNCTION nlevel(ltree);
-
-DROP FUNCTION index(ltree,ltree,int4);
-
-DROP FUNCTION index(ltree,ltree);
-
-DROP FUNCTION subpath(ltree,int4);
-
-DROP FUNCTION subpath(ltree,int4,int4);
-
-DROP FUNCTION subltree(ltree,int4,int4);
-
-DROP OPERATOR <> (ltree, ltree);
-
-DROP OPERATOR = (ltree, ltree);
-
-DROP OPERATOR > (ltree, ltree);
-
-DROP OPERATOR >= (ltree, ltree);
-
-DROP OPERATOR <= (ltree, ltree);
-
-DROP OPERATOR < (ltree, ltree);
-
-DROP FUNCTION ltree_ne(ltree,ltree);
-
-DROP FUNCTION ltree_gt(ltree,ltree);
-
-DROP FUNCTION ltree_ge(ltree,ltree);
-
-DROP FUNCTION ltree_eq(ltree,ltree);
-
-DROP FUNCTION ltree_le(ltree,ltree);
-
-DROP FUNCTION ltree_lt(ltree,ltree);
-
-DROP FUNCTION ltree_cmp(ltree,ltree);
-
-DROP TYPE ltree CASCADE;