The present invention relates to novel heteroaryl amide derivatives of formula (I), as selective inhibitors of histone deacetylase 1 and 2 (hdac1-2), to methods for the production of same, to pharmaceutical compositions comprising these compounds, and to the use of said compounds for the production of a medicament for the treatment of pathological conditions or diseases that can be improved by means of the inhibition of the activity of histone deacetylase class I, particularly HDAC1 and HDAC2, such as cancer, neurodegenerative diseases, infectious diseases, inflammatory diseases, heart failure and cardiac hypertrophy, diabetes, polycystic kidney disease, sickle cell disease and ß-thalassemia disease, and to methods for the treatment of the diseases mentioned above.