Genetic factors may contribute to the differential response to opioids. The aim of this study was to evaluate the association between polymorphisms of µ1-opioid receptor gene OPRM1 (rs1799971), and P-glycoprotein transporter gene ABCB1 (rs1045642, rs2032582), and piritramide efficacy under postoperative patient-controlled analgesia (PCA). In 51 patients, OPRM1 variant was associated with decreased efficacy in early postoperative period evidenced by sum of pain intensity difference in the 0-6 h postoperative period (SPID(0-6)), (F=3.27, p=0.029). Mean (SD) SPID(0-6) was observed in the 118AA genotype 22.9 (6.1) mm, which was significantly higher from the 118GG genotype 10.0 (4.4) mm, p=0.006. The lowest cumulative dose was recorded in 118AA genotype 19.1 (9.8) mg, which was significantly less than in the 118GG genotype group 36.6 (6.1) mg, p=0.017. Opioid-induced adverse effects were observed in 11, 30, and 100 % of patients in 118AA, 118AG, and 118GG genotype groups, respectively (p<0.05). Piritramide efficacy and safety was not significantly affected by ABCB1 (rs1045642, rs2032582) polymorphisms. Variant OPRM1 118G allele is associated with decreased acute postoperative pain relief after piritramide. Decreased efficacy leads to higher drug consumption under PCA settings, which however, does not fully compensate insufficient pain relief, but increases incidence of adverse effects.