Pyridinium methanesulfonate (m.p. 185 degrees C) and pyridinium p-toluenesulfonate (m.p. 121 degrees C) were used as catalysts and media for the esterification of carboxylic acids with primary alcohols to give the corresponding esters selectively in high yields. The high melting points of these pyridinium salts did not prevent their application as ionic liquid medium for these reactions which were performed at 90 degrees C.