As part of our introduction to self-service publishing in the Terraform Registry, this copy of the provider has been archived, and ownership has been transferred to active maintainers in the community. Please see the new location on the Terraform Registry: https://registry.terraform.io/providers/cyrilgdn/postgresql
When defining a search path in a PostgreSQL role which contains a hyphen it is saved as a quoted string in the DB. Once it is retrieved from the database the provider saves the quoted search path in the terraform state. Next time the changes are applied this is detected as a change that will be applied, although it actually is not a change.
Solution
When reading the search path from PostgreSQL we have to trim the quotes.
Issue
When defining a search path in a PostgreSQL role which contains a hyphen it is saved as a quoted string in the DB. Once it is retrieved from the database the provider saves the quoted search path in the terraform state. Next time the changes are applied this is detected as a change that will be applied, although it actually is not a change.
Solution
When reading the search path from PostgreSQL we have to trim the quotes.