To identify pathogenetic factors associated with the development of peptic ulcers in patients following cardiac surgery and to examine the efficacy of medical and surgical therapy of peptic ulcers in this setting. Retrospective study with randomly selected case controls. University hospital referral practice. A total of 9,199 consecutive patients undergoing procedures requiring cardiopulmonary bypass between January 1, 1980 through September 30, 1988, were reviewed. Life-threatening ulcer complications were defined as hemorrhage of greater than 2 units of packed red blood cells which prompted subspecialty consultation and required a therapeutic intervention. Patients who developed life-threatening complications of peptic ulcers (32/9199, 0.35%) (group 1) were compared with 32 randomly selected patients (group 2) for differences in potential pathogenetic factors and outcome. Gastrointestinal hemorrhage, perforated ulcers, death. Patients in group 1 were significantly older than patients in group 2 (66.7 +/- 7.9 vs. 54 +/- 10 yrs, p less than .01). Complications following cardiopulmonary bypass requiring further surgery or causing prolonged hypotension were significantly more frequent in patients with ulcers than in controls (10/32 vs. 1/32, p less than .005). The mortality rate for patients in group 1 was 34.3% (11/32) compared with 0% in group 2 (p less than .001). Perioperative ulcer prophylaxis was employed with equal frequency in groups 1 and 2 and did not correlate with outcome. The development of complications of postoperative peptic ulcers following cardiac surgery correlates with age, need for reoperation, and hypoperfusion, but not with the use of prophylactic regimens to suppress acid secretion. These results suggest that impairment of gastric and duodenal mucosal defense mechanisms is a critical factor in the development of postoperative peptic ulcers.