I am trying to install pg_trgm into postgres (Using postgres 9.5 on ubuntu 16) by doing CREATE EXTENSION pg_trgm
. The first executable line of pg_trgm--1.1.sql is
CREATE FUNCTION set_limit(float4)
RETURNS float4
AS 'MODULEPATH_NAME'
LANGUAGE C STRICT VOLATILE;
Running this line in psql or starting psql with psql -f pg_trgm--1.1.sql
throws error ERROR: cache lookup failed for function 1
. Any idea why this might be happening. I also tried
CREATE FUNCTION add(integer, integer) RETURNS integer
AS 'select $1 + $2;'
LANGUAGE SQL
IMMUTABLE
RETURNS NULL ON NULL INPUT;
which works fine. Do I have to install something to create sql functions using C language? I already installed contrib for postgres using sudo apt-get install postgresql-contrib