Skip to content

Commit

Permalink
Fix(PLACEHOLDER-123): Error granting role pg_database_owner to postgr…
Browse files Browse the repository at this point in the history
…es: pq: role pg_database_owner cannot have explicit members (#13)

…
  • Loading branch information
achellouche authored Jun 28, 2024
2 parents 023e5b3 + 8702b3d commit cb5973e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion postgresql/resource_postgresql_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,14 @@ func resourcePostgreSQLSchemaCreate(db *DBConnection, d *schema.ResourceData) er
}
rolesToGrant = append(rolesToGrant, dbOwner)

schemaOwner := d.Get("owner").(string)
owners := []string{}
owners = append(owners, d.Get("owner").(string))
owners, err = resolveOwners(txn, owners)
if err != nil {
return err
}
schemaOwner := owners[0]

if schemaOwner != "" && schemaOwner != dbOwner {
rolesToGrant = append(rolesToGrant, schemaOwner)

Expand Down

0 comments on commit cb5973e

Please sign in to comment.