Support functions for index opclasses should be immutable.

Found by running opr_sanity on contrib modules.
This commit is contained in:
Tom Lane 2007-09-30 15:52:06 +00:00
parent 60e83cec57
commit f8203f908e
2 changed files with 24 additions and 24 deletions

View File

@ -5,27 +5,27 @@ BEGIN;
create function set_limit(float4)
returns float4
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
create function show_limit()
returns float4
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
create function show_trgm(text)
returns _text
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
create function similarity(text,text)
returns float4
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
create function similarity_op(text,text)
returns bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR % (
LEFTARG = text,
@ -40,12 +40,12 @@ CREATE OPERATOR % (
CREATE FUNCTION gtrgm_in(cstring)
RETURNS gtrgm
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT;
CREATE FUNCTION gtrgm_out(gtrgm)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT;
CREATE TYPE gtrgm (
INTERNALLENGTH = -1,
@ -57,37 +57,37 @@ CREATE TYPE gtrgm (
CREATE FUNCTION gtrgm_consistent(gtrgm,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gtrgm_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gtrgm_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gtrgm_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION gtrgm_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gtrgm_union(bytea, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gtrgm_same(gtrgm, gtrgm, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
-- create the operator class for gist
CREATE OPERATOR CLASS gist_trgm_ops
@ -107,17 +107,17 @@ AS
CREATE FUNCTION gin_extract_trgm(text, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gin_extract_trgm(text, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gin_trgm_consistent(internal, internal, text)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
-- create the operator class for gin
CREATE OPERATOR CLASS gin_trgm_ops

View File

@ -323,37 +323,37 @@ CREATE OPERATOR ~ (
CREATE FUNCTION gseg_consistent(internal,seg,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gseg_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gseg_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gseg_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION gseg_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gseg_union(internal, internal)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
CREATE FUNCTION gseg_same(seg, seg, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
LANGUAGE C IMMUTABLE;
-- Create the operator classes for indexing