Filling the blank in Magnusseen's answer.
By writing $P(x)=(x-1)(x+2)Q(x)$ it must be that $Q(x)=Q(x-3)+3$.
Taking derivatives on both sides, $Q'(x)=Q'(x-3)$. Either $Q'$ is a non-zero constant or we can consider $z\in \mathbb C$ a root of $Q'$. Then $Q'(z-3)=0$. Using this argument repeatedly, one finds that all the $z-3n$ where $n\in \mathbb N$ are roots of $Q'$, hence $Q'=0$.
To sum up, there is some $c\in \mathbb R$ such that $Q'=c$, hence $Q(x)=cx+d$ for some $d\in \mathbb R$. Plugging this back into $Q(x)=Q(x-3)+3$ and equating coefficients, we must have $c=1$ and $d$ in undetermined.
Conversely, $Q(x)=x+d$ fits the bill, no matter $d$.