Open RoseateSpoonbill opened 1 year ago
I think this is fixed in https://github.com/cyrilgdn/terraform-provider-postgresql/pull/219, which was released in v1.17.1. Which version are you using?
I am using v1.17.1. Updating to 1.17.1 solved part of the issue I was seeing, but I still see a diff if the table list in the Terraform configuration is not in alphabetical order
I am trying to add the configuration of an existing Postgres publication into Terraform. The import works but afterwards
terraform plan
shows a difference in the table order/sortingTerraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
If the elements of the table list are the same in Terraform as in the database, there should be no change to the
tables
argument, regardless of what order the tables are listed in in the configuration.Actual Behavior
Terraform tries to change the table order when the configuration's table order is not sorted, even though the actual elements are the same.
Steps to Reproduce
terraform import module.module1.postgresql_publication.pub_test database1.test
terraform plan
Important Factoids
This issue doesn't happen if the tables are listed in the configuration in alphabetical order
References
Suggestion
I don't know GO but I think that this issue could be resolved by sorting both lists of tables (from the config argument and from the database), the same way, before they were compared