Normally if you deploy the package on an existing installation it will automatically upgrade components that are installed. For GitLab 12 the PostgreSQL database will be automatically upgraded to version 10.7 unless you create a file called /etc/gitlab/disable-postgresql-upgrade. Always read the release notes for special instructions when upgrading. For version 12 they are here: https://docs.gitlab.com/omnibus/update/gitlab_12_changes.html.