Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collations for postgresql server no longer accepted #23779

Closed
1 task done
Bv-Lucas opened this issue Nov 5, 2023 · 1 comment · Fixed by #23783
Closed
1 task done

Collations for postgresql server no longer accepted #23779

Bv-Lucas opened this issue Nov 5, 2023 · 1 comment · Fixed by #23783

Comments

@Bv-Lucas
Copy link

Bv-Lucas commented Nov 5, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Hello

My issue seems related to #23167 that was fixed by #23171

Starting with azurerm_provider version 3.69.0, using "French_France.1252" as collation for postgresql database is no longer accepted and causes the plan to fail with this error:

│ Error: collation contains unknown collation French_France.1252

│ with azurerm_postgresql_database.mayday,
│ on postgresql-grs.tf line 42, in resource "azurerm_postgresql_database" "database":
│ 42: collation = "French_France.1252"

Prior to 3.69.0 this collation was accepted and is valid when looking at postgresql server configuration.

If I change it, terraform sees this change as breaking change and wants to re-create my database, which is really not what I want.

It seems like the issue raised in 23167 was more than just English_United Kingdom.1252, validation of collation apparently changed between 3.68 and 3.69 causing this error.

Terraform Version

1.1.5

AzureRM Provider Version

3.79.0

Affected Resource(s)/Data Source(s)

azurerm_postgresql_database

Terraform Configuration Files

resource "azurerm_resource_group" "example" {
  name     = "api-rg-pro"
  location = "West Europe"
}

resource "azurerm_postgresql_server" "example" {
  name                = "postgresql-server-1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  sku_name = "B_Gen5_2"

  storage_mb                   = 5120
  backup_retention_days        = 7
  geo_redundant_backup_enabled = false
  auto_grow_enabled            = true

  administrator_login          = "psqladmin"
  administrator_login_password = "H@Sh1CoR3!"
  version                      = "9.5"
  ssl_enforcement_enabled      = true
}

resource "azurerm_postgresql_database" "example" {
  name                = "exampledb"
  resource_group_name = azurerm_resource_group.example.name
  server_name         = azurerm_postgresql_server.example.name
  charset             = "UTF8"
  collation           = "French_France.1252"
}

Debug Output/Panic Output

│ Error: collation contains unknown collation French_France.1252
│ 
│   with azurerm_postgresql_database.mayday,
│   on postgresql-grs.tf line 42, in resource "azurerm_postgresql_database" "database":
│   42:   collation           = "French_France.1252"

Expected Behaviour

The database configuration should be validated by terraform plan

Actual Behaviour

terraform plan displays this error and fails :
│ Error: collation contains unknown collation French_France.1252

│ with azurerm_postgresql_database.mayday,
│ on postgresql-grs.tf line 42, in resource "azurerm_postgresql_database" "database":
│ 42: collation = "French_France.1252"

Steps to Reproduce

  1. set azurerm provider version to 3.68.0
  2. use configuration provided above
  3. plan is valid
  4. set azurerm provider version to 3.69.0 or above
  5. use configuration provided above
  6. plan fails

Important Factoids

No response

References

My issue seems related to #23167 that was fixed by #23171
It looks like this PR fixed the collation validation only for English_United Kingdom.1252 but it appears more collations were no longer valid when changing azurerm provider version from 3.68 to 3.69

Copy link

github-actions bot commented May 2, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant