Skip running empty set of queries
This commit is contained in:
		
							parent
							
								
									6183203f4d
								
							
						
					
					
						commit
						1211220208
					
				|  | @ -118,6 +118,10 @@ func (s DefaultUserSyncStrategy) alterPgUser(user spec.PgUser, db *sql.DB) (err | ||||||
| 		grantStmt := produceGrantStmt(user) | 		grantStmt := produceGrantStmt(user) | ||||||
| 		resultStmt = append(resultStmt, grantStmt) | 		resultStmt = append(resultStmt, grantStmt) | ||||||
| 	} | 	} | ||||||
|  | 	if len(resultStmt) == 0 { | ||||||
|  | 		return nil | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	query := fmt.Sprintf(doBlockStmt, strings.Join(resultStmt, ";")) | 	query := fmt.Sprintf(doBlockStmt, strings.Join(resultStmt, ";")) | ||||||
| 
 | 
 | ||||||
| 	_, err = db.Query(query) // TODO: Try several times
 | 	_, err = db.Query(query) // TODO: Try several times
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue