The aim of the study was to investigate a possible association of the catechol-O-methyltransferase (COMT) and μ-opioid receptor (OPRM1) genotypes with pain perception in patients undergoing total hip replacement and total knee replacement taking into account aspects such as age, sex and diabetes. Here, COMT is linked to diabetes mellitus.