I'm not sure I understand your question correctly, but GoCD manages its own database schema and will upgrade it automatically if necessary on first launch of any GoCD server version that has a schema change. These changes are supported across H2/Postgres/Mysql and are expressed in a DB-agnostic way. The need to manage schema is effectively why
the documentation implies that the GoCD user needs quite broad permissions rather than DML alone.
Accordingly to migrate from H2 to Postgres, you'd need to do so with
https://github.com/gocd/gocd-database-migrator using a similar process as noted in
https://docs.gocd.org/current/installation/upgrading_go/upgrade_to_gocd_20.5.0.html to ensure the metadata for determining the schema version comes across correctly with your data.
Since you earlier asked about upgrading GoCD, if you haven't yet upgraded past 20.5.0, doing the switch to Postgres during the 20.4.0 to 20.5.0 upgrade is probably the best time since you have to do manual DB migration work at this step anyway.