TITLE: Example of a variety with $K_X$ $\mathbb Q$-Cartier but not Cartier
QUESTION [23 upvotes]: I know the definition of $K_X$ on a normal, singular variety, but I don't have a good set of examples in my mind.  What's an example of a variety where $K_X$ is $\mathbb Q$-Cartier but not Cartier?  Are there any conditions under which an adjunction formula lets me compute the canonical class of a singular divisor?

REPLY [6 votes]: Here is a more algebraic perspective on your question. If $X=\text{Spec} (R)$ is affine and $R$ is a Cohen-Macaulay algebra over some field (the following is true in more general setting), then $K_X$ is Cartier is equivalent to $R$ is Gorenstein. On the other hand, $K_X$ is $\mathbb Q$-Cartier is the same as the class of $K_X$ is torsion in the divisor class group (assuming $R$ is normal).
So to find a class of examples, you need normal Cohen-Macaulay rings with torsion class group but not Gorenstein. If $R$ is a Veronese $S^{(d)}$ of $S=\mathbb C[x_1,\cdots, x_n]$  then $Cl(R)$ is always torsion, but $R$ is Gorenstein if and only if $d|n$ (Sandor's example is indeed the simplest one in this class, with $d=2, n=3$).