If you installed Ambari server with a PostgresQL database and upgrading Ambari Server using a remote or public repository failed, use the following steps to fix the upgrade.
Upgrade the database schema.
var/lib/ambari-server/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql with the following parameters: dbname = ambari username = ambari
Check database consistency.
var/lib/ambari-server/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.Check.sql with the following parameter: dbname = ambari
If you find an inconsistency, fix it using
var/lib/ambari-server/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.Fix.sql with the following parameter: dbname = ambari