Commit f8203f90 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 60e83cec
...@@ -5,27 +5,27 @@ BEGIN; ...@@ -5,27 +5,27 @@ BEGIN;
create function set_limit(float4) create function set_limit(float4)
returns float4 returns float4
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE; LANGUAGE C STRICT IMMUTABLE;
create function show_limit() create function show_limit()
returns float4 returns float4
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE; LANGUAGE C STRICT IMMUTABLE;
create function show_trgm(text) create function show_trgm(text)
returns _text returns _text
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE; LANGUAGE C STRICT IMMUTABLE;
create function similarity(text,text) create function similarity(text,text)
returns float4 returns float4
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE; LANGUAGE C STRICT IMMUTABLE;
create function similarity_op(text,text) create function similarity_op(text,text)
returns bool returns bool
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE; LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR % ( CREATE OPERATOR % (
LEFTARG = text, LEFTARG = text,
...@@ -40,12 +40,12 @@ CREATE OPERATOR % ( ...@@ -40,12 +40,12 @@ CREATE OPERATOR % (
CREATE FUNCTION gtrgm_in(cstring) CREATE FUNCTION gtrgm_in(cstring)
RETURNS gtrgm RETURNS gtrgm
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT; LANGUAGE C STRICT;
CREATE FUNCTION gtrgm_out(gtrgm) CREATE FUNCTION gtrgm_out(gtrgm)
RETURNS cstring RETURNS cstring
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT; LANGUAGE C STRICT;
CREATE TYPE gtrgm ( CREATE TYPE gtrgm (
INTERNALLENGTH = -1, INTERNALLENGTH = -1,
...@@ -57,37 +57,37 @@ CREATE TYPE gtrgm ( ...@@ -57,37 +57,37 @@ CREATE TYPE gtrgm (
CREATE FUNCTION gtrgm_consistent(gtrgm,internal,int4) CREATE FUNCTION gtrgm_consistent(gtrgm,internal,int4)
RETURNS bool RETURNS bool
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gtrgm_compress(internal) CREATE FUNCTION gtrgm_compress(internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gtrgm_decompress(internal) CREATE FUNCTION gtrgm_decompress(internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gtrgm_penalty(internal,internal,internal) CREATE FUNCTION gtrgm_penalty(internal,internal,internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT; LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION gtrgm_picksplit(internal, internal) CREATE FUNCTION gtrgm_picksplit(internal, internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gtrgm_union(bytea, internal) CREATE FUNCTION gtrgm_union(bytea, internal)
RETURNS _int4 RETURNS _int4
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gtrgm_same(gtrgm, gtrgm, internal) CREATE FUNCTION gtrgm_same(gtrgm, gtrgm, internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
-- create the operator class for gist -- create the operator class for gist
CREATE OPERATOR CLASS gist_trgm_ops CREATE OPERATOR CLASS gist_trgm_ops
...@@ -107,17 +107,17 @@ AS ...@@ -107,17 +107,17 @@ AS
CREATE FUNCTION gin_extract_trgm(text, internal) CREATE FUNCTION gin_extract_trgm(text, internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gin_extract_trgm(text, internal, internal) CREATE FUNCTION gin_extract_trgm(text, internal, internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gin_trgm_consistent(internal, internal, text) CREATE FUNCTION gin_trgm_consistent(internal, internal, text)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
-- create the operator class for gin -- create the operator class for gin
CREATE OPERATOR CLASS gin_trgm_ops CREATE OPERATOR CLASS gin_trgm_ops
......
...@@ -323,37 +323,37 @@ CREATE OPERATOR ~ ( ...@@ -323,37 +323,37 @@ CREATE OPERATOR ~ (
CREATE FUNCTION gseg_consistent(internal,seg,int4) CREATE FUNCTION gseg_consistent(internal,seg,int4)
RETURNS bool RETURNS bool
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gseg_compress(internal) CREATE FUNCTION gseg_compress(internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gseg_decompress(internal) CREATE FUNCTION gseg_decompress(internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gseg_penalty(internal,internal,internal) CREATE FUNCTION gseg_penalty(internal,internal,internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C STRICT; LANGUAGE C STRICT IMMUTABLE;
CREATE FUNCTION gseg_picksplit(internal, internal) CREATE FUNCTION gseg_picksplit(internal, internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gseg_union(internal, internal) CREATE FUNCTION gseg_union(internal, internal)
RETURNS seg RETURNS seg
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
CREATE FUNCTION gseg_same(seg, seg, internal) CREATE FUNCTION gseg_same(seg, seg, internal)
RETURNS internal RETURNS internal
AS 'MODULE_PATHNAME' AS 'MODULE_PATHNAME'
LANGUAGE C; LANGUAGE C IMMUTABLE;
-- Create the operator classes for indexing -- Create the operator classes for indexing
......
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