gitlab-psql system user is hardcoded in pg_upgrade.rb
The system user gitlab-psql is hardcoded in the migration of postgresql. Automigration doesn't work for installations where a different user is configured in the postgresql['username']
setting of gitlab.rb.
def run_pg_command(command)
GitlabCtl::Util.get_command_output("su - gitlab-psql -c \"#{command}\"")
end
As a workaround, we had to disable auto migrations and edit the relevant portion of pg_upgrade.rb to force usage of our configured user before running the automigration manually