Solution (source code)

= Solution

Multiplying the Gaussian likelihood and prior and <completing the square> gives
$$
p(\theta\mid y)
\propto
\exp\!\left[-\frac12\left\{
\frac{(y-\theta)^2}{\sigma^2}+\frac{\theta^2}{\tau^2}
\right\}\right].
$$
Therefore <Normal-normal conjugacy> gives
$$
\theta\mid y\sim N(m,v),
\qquad
m=\frac{\tau^2}{\sigma^2+\tau^2}y,
\qquad
v=\frac{\sigma^2\tau^2}{\sigma^2+\tau^2}.
$$