X-Git-Url: http://sigaev.ru/git/gitweb.cgi?p=smlar.git;a=blobdiff_plain;f=smlar_guc.c;h=8ff0ad3d675ca0c29f6967a05df8c63f58f71de8;hp=f4377745148b6b45ec6d7816b2d902d151dd7d42;hb=8d02df18c0bbfd6ccba94a9582499ec8746047e5;hpb=0bc52593d34ce24b38cbd4fb6225d97601c5b871 diff --git a/smlar_guc.c b/smlar_guc.c index f437774..8ff0ad3 100644 --- a/smlar_guc.c +++ b/smlar_guc.c @@ -39,7 +39,7 @@ SmlarLogAssign(bool newval, void *extra) static int smlar_smltype = ST_COSINE; static const struct config_enum_entry SmlarTypeOptions[] = { - {"cosine", ST_COSINE, false}, + {"cosine", ST_COSINE, false}, {"tfidf", ST_TFIDF, false}, {"overlap", ST_OVERLAP, false}, {NULL, 0, false} @@ -47,7 +47,7 @@ static const struct config_enum_entry SmlarTypeOptions[] = { static int smlar_tf_method = TF_N; static const struct config_enum_entry SmlarTFOptions[] = { - {"n", TF_N, false}, + {"n", TF_N, false}, {"log", TF_LOG, false}, {"const", TF_CONST, false}, {NULL, 0, false} @@ -199,24 +199,28 @@ GetSmlarUsePersistent(void) } PG_FUNCTION_INFO_V1(set_smlar_limit); -Datum set_smlar_limit(PG_FUNCTION_ARGS); +Datum set_smlar_limit(PG_FUNCTION_ARGS); Datum set_smlar_limit(PG_FUNCTION_ARGS) { - float4 nlimit = PG_GETARG_FLOAT4(0); - char buf[32]; + float4 nlimit = PG_GETARG_FLOAT4(0); + char buf[32]; /* 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()); } PG_FUNCTION_INFO_V1(show_smlar_limit); -Datum show_smlar_limit(PG_FUNCTION_ARGS); +Datum show_smlar_limit(PG_FUNCTION_ARGS); Datum show_smlar_limit(PG_FUNCTION_ARGS) {