Commit ae57efed authored by Tom Lane's avatar Tom Lane

Support functions for index opclasses should be immutable.

Found by running opr_sanity on contrib modules.
parent 2e0c47e5
......@@ -4,12 +4,12 @@ SET search_path = public;
CREATE FUNCTION ltree_in(cstring)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT;
CREATE FUNCTION ltree_out(ltree)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT;
CREATE TYPE ltree (
INTERNALLENGTH = -1,
......@@ -23,37 +23,37 @@ CREATE TYPE ltree (
CREATE FUNCTION ltree_cmp(ltree,ltree)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_lt(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_le(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_eq(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_ge(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_gt(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_ne(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR < (
......@@ -123,112 +123,112 @@ CREATE OPERATOR <> (
CREATE FUNCTION subltree(ltree,int4,int4)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION subpath(ltree,int4,int4)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION subpath(ltree,int4)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION index(ltree,ltree)
RETURNS int4
AS 'MODULE_PATHNAME', 'ltree_index'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION index(ltree,ltree,int4)
RETURNS int4
AS 'MODULE_PATHNAME', 'ltree_index'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION nlevel(ltree)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree2text(ltree)
RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION text2ltree(text)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION lca(_ltree)
RETURNS ltree
AS 'MODULE_PATHNAME','_lca'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_isparent(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_risparent(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_addltree(ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_addtext(ltree,text)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltree_textadd(text,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltreeparentsel(internal, oid, internal, integer)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR @> (
LEFTARG = ltree,
......@@ -301,12 +301,12 @@ CREATE OPERATOR CLASS ltree_ops
CREATE FUNCTION lquery_in(cstring)
RETURNS lquery
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT;
CREATE FUNCTION lquery_out(lquery)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT;
CREATE TYPE lquery (
INTERNALLENGTH = -1,
......@@ -318,12 +318,12 @@ CREATE TYPE lquery (
CREATE FUNCTION ltq_regex(ltree,lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltq_rregex(lquery,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR ~ (
LEFTARG = ltree,
......@@ -365,12 +365,12 @@ CREATE OPERATOR ^~ (
CREATE FUNCTION lt_q_regex(ltree,_lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION lt_q_rregex(_lquery,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR ? (
LEFTARG = ltree,
......@@ -412,12 +412,12 @@ CREATE OPERATOR ^? (
CREATE FUNCTION ltxtq_in(cstring)
RETURNS ltxtquery
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT;
CREATE FUNCTION ltxtq_out(ltxtquery)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT;
CREATE TYPE ltxtquery (
INTERNALLENGTH = -1,
......@@ -431,12 +431,12 @@ CREATE TYPE ltxtquery (
CREATE FUNCTION ltxtq_exec(ltree, ltxtquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION ltxtq_rexec(ltxtquery, ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR @ (
LEFTARG = ltree,
......@@ -479,12 +479,12 @@ CREATE OPERATOR ^@ (
CREATE FUNCTION ltree_gist_in(cstring)
RETURNS ltree_gist
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT;
CREATE FUNCTION ltree_gist_out(ltree_gist)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT;
CREATE TYPE ltree_gist (
internallength = -1,
......@@ -495,25 +495,25 @@ CREATE TYPE ltree_gist (
CREATE FUNCTION ltree_consistent(internal,internal,int2)
RETURNS bool as 'MODULE_PATHNAME' LANGUAGE C;
RETURNS bool as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
CREATE FUNCTION ltree_compress(internal)
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C;
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
CREATE FUNCTION ltree_decompress(internal)
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C;
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
CREATE FUNCTION ltree_penalty(internal,internal,internal)
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C RETURNS NULL ON NULL INPUT;
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION ltree_picksplit(internal, internal)
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C;
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
CREATE FUNCTION ltree_union(internal, internal)
RETURNS int4 as 'MODULE_PATHNAME' LANGUAGE C;
RETURNS int4 as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
CREATE FUNCTION ltree_same(internal, internal, internal)
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C;
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
CREATE OPERATOR CLASS gist_ltree_ops
DEFAULT FOR TYPE ltree USING gist AS
......@@ -545,52 +545,52 @@ CREATE OPERATOR CLASS gist_ltree_ops
CREATE FUNCTION _ltree_isparent(_ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION _ltree_r_isparent(ltree,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION _ltree_risparent(_ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION _ltree_r_risparent(ltree,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION _ltq_regex(_ltree,lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION _ltq_rregex(lquery,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION _lt_q_regex(_ltree,_lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION _lt_q_rregex(_lquery,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION _ltxtq_exec(_ltree, ltxtquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION _ltxtq_rexec(ltxtquery, _ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR @> (
LEFTARG = _ltree,
......@@ -778,7 +778,7 @@ CREATE OPERATOR ^@ (
CREATE FUNCTION _ltree_extract_isparent(_ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR ?@> (
LEFTARG = _ltree,
......@@ -789,7 +789,7 @@ CREATE OPERATOR ?@> (
CREATE FUNCTION _ltree_extract_risparent(_ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR ?<@ (
LEFTARG = _ltree,
......@@ -800,7 +800,7 @@ CREATE OPERATOR ?<@ (
CREATE FUNCTION _ltq_extract_regex(_ltree,lquery)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR ?~ (
LEFTARG = _ltree,
......@@ -811,7 +811,7 @@ CREATE OPERATOR ?~ (
CREATE FUNCTION _ltxtq_extract_exec(_ltree,ltxtquery)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR ?@ (
LEFTARG = _ltree,
......@@ -823,32 +823,32 @@ CREATE OPERATOR ?@ (
CREATE FUNCTION _ltree_consistent(internal,internal,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION _ltree_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION _ltree_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION _ltree_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION _ltree_union(internal, internal)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION _ltree_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE OPERATOR CLASS gist__ltree_ops
DEFAULT FOR TYPE _ltree USING gist AS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment