Skip to content

Commit

Permalink
Fix migration to Machines for databases with hyphens
Browse files Browse the repository at this point in the history
  • Loading branch information
pborzenkov committed Apr 18, 2023
1 parent a3c883f commit e287736
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/flypg/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func SetReadonly(ctx context.Context, pg *pgx.Conn, enable bool) error {
continue
}

sql := fmt.Sprintf("ALTER DATABASE %s SET default_transaction_read_only=%v;", db.Name, enable)
sql := fmt.Sprintf("ALTER DATABASE %q SET default_transaction_read_only=%v;", db.Name, enable)
if _, err = pg.Exec(ctx, sql); err != nil {
return fmt.Errorf("failed to alter readonly state on db %s: %s", db.Name, err)
}
Expand Down

0 comments on commit e287736

Please sign in to comment.