Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Commit

Permalink
fix case sensitive issue in pqsql binding commands (#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongyi-zhang authored and norshtein committed Jul 19, 2019
1 parent 87d222f commit 6c08146
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/services/postgresql/common_provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func setupDatabase(
}
}()
if _, err = tx.Exec(
fmt.Sprintf("create role %s", dbName),
fmt.Sprintf(`create role "%s"`, dbName),
); err != nil {
return fmt.Errorf(`error creating role "%s": %s`, dbName, err)
}
Expand All @@ -163,7 +163,7 @@ func setupDatabase(
// to make admin role to be a member of created db role.
// Please see: https://www.postgresql.org/docs/10/role-membership.html
if _, err = tx.Exec(
fmt.Sprintf("grant %s to %s", dbName, administratorLogin),
fmt.Sprintf(`grant "%s" to "%s"`, dbName, administratorLogin),
); err != nil {
return fmt.Errorf(
`error adding role "%s" to role "%s": %s`,
Expand All @@ -174,7 +174,7 @@ func setupDatabase(
}
if _, err = tx.Exec(
fmt.Sprintf(
"alter database %s owner to %s",
`alter database "%s" owner to "%s"`,
dbName,
dbName,
),
Expand Down
2 changes: 1 addition & 1 deletion tests/lifecycle/postgresql_cases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ var postgresqlTestCases = []serviceLifecycleTestCase{
},
"backupRedundancy": "geo",
"adminAccountSettings": map[string]interface{}{
"adminUsername": "postgresqladmin",
"adminUsername": "postgresqlAdmin",
"adminPassword": generate.NewPassword(),
},
"serverName": uuid.NewV4().String() + "-specified",
Expand Down

0 comments on commit 6c08146

Please sign in to comment.