Fix inconsistent result after apply in PostgreSQL Flex database (#488)

This commit is contained in:
João Palet 2024-08-01 11:24:23 +01:00 committed by GitHub
parent 1e767d56dc
commit 5807e2ba2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -348,6 +348,9 @@ func mapFields(databaseResp *postgresflex.InstanceDatabase, model *Model) error
if !ok {
return fmt.Errorf("owner is not a string")
}
// If the field is returned between with quotes, we trim them to prevent an inconsistent result after apply
ownerStr = strings.TrimPrefix(ownerStr, `"`)
ownerStr = strings.TrimSuffix(ownerStr, `"`)
model.Owner = types.StringValue(ownerStr)
}
}