Skip to content

Commit

Permalink
Pass correct role name to SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
williammoran committed May 7, 2024
1 parent 2a1c8af commit 816e3a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/format/pgsql8/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Initdb(t *testing.T, dbSuffix string) *pgx.Conn {
}

func CreateRoleIfNotExists(conn *pgx.Conn, name string) error {
_, err := conn.Exec(context.TODO(), fmt.Sprintf("CREATE ROLE %s", ir.AdditionalRole))
_, err := conn.Exec(context.TODO(), fmt.Sprintf("CREATE ROLE %s", name))
if err != nil {
code := (err.(*pgconn.PgError)).Code
if code != "42710" && code != "23505" { // Role exists
Expand Down

0 comments on commit 816e3a2

Please sign in to comment.