support 9.5
authorTeodor Sigaev <teodor@sigaev.ru>
Mon, 19 Sep 2016 11:48:35 +0000 (14:48 +0300)
committerTeodor Sigaev <teodor@sigaev.ru>
Mon, 19 Sep 2016 11:48:35 +0000 (14:48 +0300)
smlar--1.0.sql
smlar_gin.c
smlar_guc.c

index db361c0..fcce814 100644 (file)
@@ -67,12 +67,12 @@ CREATE OR REPLACE FUNCTION inarray(anyarray, anyelement, float4, float4)
 CREATE OR REPLACE FUNCTION gsmlsign_in(cstring)
        RETURNS gsmlsign
        AS 'MODULE_PATHNAME'
-       LANGUAGE C STRICT;
+       LANGUAGE C IMMUTABLE;
 
 CREATE OR REPLACE FUNCTION gsmlsign_out(gsmlsign)
        RETURNS cstring
        AS 'MODULE_PATHNAME'
-       LANGUAGE C STRICT;
+       LANGUAGE C IMMUTABLE;
 
 CREATE TYPE gsmlsign (
        INTERNALLENGTH = -1,
index 5ea1570..f43c9a5 100644 (file)
@@ -1,3 +1,5 @@
+#include <math.h>
+
 #include "smlar.h"
 
 #include "fmgr.h"
index f437774..d1cae32 100644 (file)
@@ -209,9 +209,13 @@ set_smlar_limit(PG_FUNCTION_ARGS)
        /* init smlar guc */
        initSmlarGUC();
 
-       sprintf(buf,"%f", nlimit);      
-       set_config_option("smlar.threshold", buf, 
-                                               PGC_USERSET, PGC_S_SESSION ,GUC_ACTION_SET, true, 0);
+       sprintf(buf,"%f", nlimit);
+       set_config_option("smlar.threshold", buf,
+                                               PGC_USERSET, PGC_S_SESSION ,GUC_ACTION_SET, true, 0
+#if PG_VERSION_NUM >= 90500
+                                               ,false
+#endif
+                                               );
        PG_RETURN_FLOAT4((float4)GetSmlarLimit());
 }