Escitalopram and acidity?

My pdoc told me to take acidity med(pantoprazole) daily along with lexapro(escitalopram). Pantoprazole is a Proton-pump inhibitor.

But im worried about long term side effects of pantoprazole. Stomach acid plays a role in killing ingested bacteria. Use of pantoprazole may increase the chance of developing infections such as pneumonia, particularly in hospitalized patients. [1]