mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 19:15:35 +02:00
Skip running empty set of queries
This commit is contained in:
@@ -118,6 +118,10 @@ func (s DefaultUserSyncStrategy) alterPgUser(user spec.PgUser, db *sql.DB) (err
|
||||
grantStmt := produceGrantStmt(user)
|
||||
resultStmt = append(resultStmt, grantStmt)
|
||||
}
|
||||
if len(resultStmt) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
query := fmt.Sprintf(doBlockStmt, strings.Join(resultStmt, ";"))
|
||||
|
||||
_, err = db.Query(query) // TODO: Try several times
|
||||
|
||||
Reference in New Issue
Block a user