Repository: hashicorp/terraform-provider-azurerm (Go)

Issue:
azurerm_postgresql_database collation English_United Kingdom.1252 isn't listed as an accepted value 
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Community Note

<!--- Please keep this note for the community --->

* Please vote on this issue by adding a :thumbsup: [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) 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](https://github.com/hashicorp/terraform-provider-azurerm/blob/main/contributing/README.md) to help.

<!--- Thank you for keeping this note for the community --->


### Terraform Version

1.3.6

### AzureRM Provider Version

3.71.0

### Affected Resource(s)/Data Source(s)

azurerm_postgresql_database

### Terraform Configuration Files

```hcl
terraform {
  required_version = ">= 1.3.6"

  required_providers {
    # Hard-coded version because of problem with app service slot replacement
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "3.71.0"
    }
  }
}

provider "azurerm" {
  features {
    template_deployment {
      delete_nested_items_during_deletion = false
    }
  }
}

resource "azurerm_postgresql_database" "foo" {
  name                = "foo"
  resource_group_name = azurerm_resource_group.main.name
  server_name         = azurerm_postgresql_server.main.name
  charset             = "UTF8"
  collation           = "English_United Kingdom.1252"
}

resource "azurerm_postgresql_server" "main" {
  name                = local.pwdata_sql_servername
  location            = var.location
  resource_group_name = azurerm_resource_group.main.name

  sku_name = var.postgresql_server_sku_name

  storage_mb                   = var.postgresql_server_storage_mb
  backup_retention_days        = var.postgresql_server_backup_retention_days
  geo_redundant_backup_enabled = var.postgresql_server_geo_redundant_backup_enabled
  auto_grow_enabled            = true

  administrator_login              = var.postgresql_server_administrator_login
  administrator_login_password     = var.postgresql_server_administrator_login_password
  version                          = var.postgresql_server_version
  ssl_enforcement_enabled          = var.postgresql_server_ssl_enforcement_enabled
  ssl_minimal_tls_version_enforced = "TLS1_2"
  public_network_access_enabled    = true

  lifecycle {
    ignore_changes = [
      storage_mb
    ]
  }
```


### Debug Output/Panic Output

```shell
Error: the value "English_United Kingdom.1252" is not valid for the field "collation", expected either:
│ 
│ * A language code (e.g. 'de', 'en' or 'ja')
│ * A language code and locale with a dash (e.g. 'de-DE', 'en-GB' or 'ja-JP')
│ * A language code and locale with an underscore (e.g. 'de_DE', 'en_GB' or 'ja_JP')
│ * One of the following values: ".utf8", "C", "POSIX", "English_United States.1252", "ucs_basic", "default"
│ 
│ This value can optionally end in '.utf8'
│ 
│ but got "English_United Kingdom.1252"
│ 
│ 
│   with azurerm_postgresql_database.foo,
│   on pg_main.tf line 54, in resource "azurerm_postgresql_database" "foo":
│   54:   collation           = "English_United Kingdom.1252"
```


### Expected Behaviour

It should accept the value `English_United Kingdom.1252`

### Actual Behaviour

I get the error message from above

### Steps to Reproduce

1. Set up your DB as per the terraform above
2. Plan and apply
3. Observe the error

If you create the DB using an older version of the provider, it will work and if you import the resource locally and look in the state file, you'll see that it's showing as `English_United Kingdom.1252` in the state file.

### Important Factoids

_No response_

### References

_No response_


Discussion:
@tombuildsstuff just wanted to say thank you so much for getting the fix merged in. It's super appreciated :)
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.



Patch:
diff --git a/internal/services/postgres/validate/postgresql_database_collation.go b/internal/services/postgres/validate/postgresql_database_collation.go
index 280612a7d05c..28583744e3ed 100644
--- a/internal/services/postgres/validate/postgresql_database_collation.go
+++ b/internal/services/postgres/validate/postgresql_database_collation.go
@@ -271,12 +271,13 @@ var languageCodes = map[string]struct{}{
 }
 
 var specialCases = map[string]struct{}{
-	".utf8":                      {},
-	"C":                          {},
-	"POSIX":                      {},
-	"English_United States.1252": {},
-	"ucs_basic":                  {},
-	"default":                    {},
+	".utf8":                       {},
+	"C":                           {},
+	"POSIX":                       {},
+	"English_United Kingdom.1252": {},
+	"English_United States.1252":  {},
+	"ucs_basic":                   {},
+	"default":                     {},
 }
 
 var databaseCollationDidNotMatchError = func(fieldName, value string) error {


Test patch:
diff --git a/internal/services/postgres/validate/postgresql_database_collation_test.go b/internal/services/postgres/validate/postgresql_database_collation_test.go
index e40362dfeca7..2c776a0287a1 100644
--- a/internal/services/postgres/validate/postgresql_database_collation_test.go
+++ b/internal/services/postgres/validate/postgresql_database_collation_test.go
@@ -136,13 +136,14 @@ func TestPostgresqlDatabaseCollation_LocalesThirdComponent(t *testing.T) {
 func TestPostgresqlDatabaseCollation_SpecialCases(t *testing.T) {
 	cases := map[string]struct{}{
 		// these are special-cases
-		".utf8":                      {},
-		"C":                          {},
-		"POSIX":                      {},
-		"English_United States.1252": {},
-		"En-US":                      {},
-		"ucs_basic":                  {},
-		"default":                    {},
+		".utf8":                       {},
+		"C":                           {},
+		"POSIX":                       {},
+		"English_United Kingdom.1252": {},
+		"English_United States.1252":  {},
+		"En-US":                       {},
+		"ucs_basic":                   {},
+		"default":                     {},
 	}
 	for value := range cases {
 		t.Run(fmt.Sprintf("Value %q", value), func(t *testing.T) {