We collected preoperative and postoperative blood and fecal samples from patients with and without liver cirrhosis undergoing upper abdominal surgery. Patients were further grouped based on whether postoperative delirium occurred. This database includes untargeted metabolomics results from blood samples and gut microbiota profiles from fecal samples obtained through 16S rRNA sequencing.