  In this paper, we investigate the distribution of the maximum of character
sums over the family of primitive quadratic characters attached to fundamental
discriminants $|d|\leq x$. In particular, our work improves results of
Montgomery and Vaughan, and gives strong evidence that the Omega result of
Bateman and Chowla for quadratic character sums is optimal. We also obtain
similar results for real characters with prime discriminants up to $x$, and
deduce the interesting consequence that almost all primes with large Legendre
symbol sums are congruent to $3$ modulo $4$. Our results are motivated by a
recent work of Bober, Goldmakher, Granville and Koukoulopoulos, who proved
similar results for the family of non-principal characters modulo a large
prime. However, their method does not seem to generalize to other families of
Dirichlet characters. Instead, we use a different and more streamlined
approach, which relies mainly on the quadratic large sieve. As an application,
we consider a question of Montgomery concerning the positivity of sums of
Legendre symbols.
