Use a string instead of the `%t` modifier for printing a bool in SQL

This commit is contained in:
Sean Chittenden 2016-09-05 23:41:24 -07:00
parent 5b66bf0745
commit 3779dfffa9
No known key found for this signature in database
GPG Key ID: 4EBC9DC16C2E5E16
1 changed files with 5 additions and 2 deletions

View File

@ -169,8 +169,11 @@ func resourcePostgreSQLDatabaseCreate(d *schema.ResourceData, meta interface{})
continue
}
val := v.(bool)
createOpts = append(createOpts, fmt.Sprintf("%s=%t", opt.sqlKey, val))
valStr := "FALSE"
if val := v.(bool); val {
valStr = "TRUE"
}
createOpts = append(createOpts, fmt.Sprintf("%s=%s", opt.sqlKey, valStr))
}
dbName := d.Get("name").(string)