Postoperative pain after peroral endoscopic myotomy occurs due to involuntary esophageal
smooth muscle spasms. Magnesium has antispasmodic properties as a smooth muscle relaxant.
This study hypothesizes that among patients having peroral endoscopic myotomy, magnesium will
reduce the incidence of postoperative pain while decreasing perioperative opioid
requirements.