TITLE: Bounding $\sum_{p\leq x} \chi(p )$ for non-principal character $\chi$
QUESTION [6 upvotes]: Suppose $\chi$ is a non-principal Dirichlet character mod $k$. Let $A(x)=\sum_{n\leq x} \chi(n)$. Since $\sum_{n\leq k} \chi(n)=0$, we easily get the bound $|A(x)|\leq \varphi(k)$ where $\varphi$ is the Euler totient function.
Now let's define $B(x)=\sum_{p\leq x} \chi(p )$ where the sum extends over primes $p\leq x$. What kind of upper bounds do we have on $|B(x)|$? I am looking for any kind of big Oh estimates.
I appreciate any help!

REPLY [5 votes]: It is known that for $x$ large and if $\chi$ is primitive with modulo $k > 2$, then
$$B(x) \ll k^{1/2} x (\log x)^{-A}$$
for any $A > 0$. The implied constant, which is ineffective, depends only on $A$.
Ref H. Iwaniec and E. Kowalski, Analytic Number Theory, AMS 53, 2004, page 124.