Are you sure you’re on 19.7.0? From the release notes, 20.5.0 introduced support for Postgres. There used to be a paid add-on previously, but it only supported version 9.6 of Postgres, if I remember correctly.
From: Samhitha Rachakonda
Subject: [go-cd] Hibernate issue with gocd
To: go-cd
Date: Wed, 9 Jun 2021 02:43:47 -0700 (PDT)
Hibernate operation: could not retrieve generated id after insert: [com.thoughtworks.go.domain.materials.git.GitMaterialInstance]; uncategorized SQLException for SQL [insert into materials (flyweightName, fingerprint, additionalData, url, username, branch, submoduleFolder, type) values (?, ?, ?, ?, ?, ?, ?, 'GitMaterial')]; SQL state [55000]; error code [0]; ERROR: currval of sequence "materials_id_seq" is not yet defined in this session; nested exception is org.postgresql.util.PSQLException: ERROR: currval of sequence "materials_id_seq" is not yet defined in this session