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

Another collation for postgresql database no longer accepted #24067

Closed
1 task done
larsgmu opened this issue Nov 29, 2023 · 1 comment · Fixed by #24070
Closed
1 task done

Another collation for postgresql database no longer accepted #24067

larsgmu opened this issue Nov 29, 2023 · 1 comment · Fixed by #24070

Comments

@larsgmu
Copy link
Contributor

larsgmu commented Nov 29, 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.

Terraform Version

1.6.2

AzureRM Provider Version

3.80.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           = "Norwegian_Norway.1252"
}

Debug Output/Panic Output

╷
│ Error: collation contains unknown collation Norwegian_Norway.1252
│ 
│   with azurerm_postgresql_database.example,
│   on db.tf line 57, in resource "azurerm_postgresql_database" "example":
│   57:   collation           = "Norwegian_Norway.1252"
│ 
╵

Expected Behaviour

The database configuration should be validated by terraform plan.

Actual Behaviour

The terraform plan fails with error:

│ Error: collation contains unknown collation Norwegian_Norway.1252

│ with azurerm_postgresql_database.example,
│ on db.tf line 57, in resource "azurerm_postgresql_database" "example":
│ 57: collation = "Norwegian_Norway.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

This issue seem highly related to two resolved issues:

  1. Issue #23167 which was fixed by pr #23171
  2. Issue #23779 which was fixed by pr #23783

Thus a fix seems to be by adding:
Norwegian_Norway.1252 to the specialCases map in internal/services/postgres/validate/postgresql_database_collation.go as well as to its corresponding test in internal/services/postgres/validate/postgresql_database_collation_test.go

Copy link

github-actions bot commented May 1, 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 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant