By using AWS re:Post, you agree to the Terms of Use
/Changing pg_trgm.similarity_threshold in RDS/

Changing pg_trgm.similarity_threshold in RDS


Hello, I would like to reduce the threshold from 0.3 to 0.1. The parameter pg_trgm.similarity_threshold doesn't exist in any parameter group and due to superuser issues I can't alter the database and change this parameter permanently. I can see that the pg_trgm extension is installed but the parameter is missing.

1 Answers

Hello AWS Customer,

As you know, the parameters for the 'pgtrgm' extension are non-standard i.e. they are not part of a standard postgresq.conf file. In RDS, we provide parameter group to enable PostgreSQL parameters, however, at present, 'pg_trgm' extension GUC parameters (given below), are not part of default parameter group of RDS PostgreSQL instance: pg_trgm.similarity_threshold, pg_trgm.word_similarity_threshold, pg_trgm.strict_word_similarity_threshold

So, you will not be able to change the values of these parameters at global level for the RDS instance.

But workaround here would be to set this parameter value at the database session level using the below set command:

"set pg_trgm.similarity_threshold=0.1;

However, the changed parameter value is valid only for the session executing the query. When a new session connects to the DB, the "pg_trgm.similarity_threshold" parameter value is set to "0.3" by default.

The internal team is already working towards incorporating this feature in RDS PostgreSQL but I don't have any ETA on its availability. Please follow the AWS blog for new feature announcements

Hope the information helps.

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions