Meu comando pg_upgrade falhou. Durante a atualização, ele me disse que, se as coisas estivessem falhando após um ponto de cortina (o que aconteceu), eu deveria:
If pg_upgrade fails after this point, you must re-initdb the
new cluster before continuing.
Mas o que isso significa?
EDITAR
$> /usr/lib/postgresql/9.3/bin/pg_upgrade -b /usr/lib/postgresql/9.2/bin -B /usr/lib/postgresql/9.3/bin -d /var/lib/postgresql/9.2/main/ -D /var/lib/postgresql/9.3/main/ -j 6 -O "-c config_file=/etc/postgresql/9.3/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.2/main/postgresql.conf"
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is a superuser ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Creating dump of global objects ok
Creating dump of database schemas
ok
Checking for presence of required libraries ok
Checking database user is a superuser ok
Checking for prepared transactions ok
If pg_upgrade fails after this point, you must re-initdb the
new cluster before continuing.
Performing Upgrade
------------------
Analyzing all rows in the new cluster ok
Freezing all rows on the new cluster ok
Deleting files from new pg_clog ok
Copying old pg_clog to new server ok
Setting next transaction ID for new cluster ok
Setting oldest multixact ID on new cluster ok
Resetting WAL archives ok
Setting frozenxid counters in new cluster ok
Restoring global objects in the new cluster ok
Adding support functions to new cluster ok
Restoring database schemas in the new cluster
template1
*failure*
Consult the last few lines of "pg_upgrade_dump_27132.log" for
the probable cause of the failure.
Failure, exiting
child worker exited abnormally: Success
Failure, exiting
*failure*
Consult the last few lines of "pg_upgrade_server.log" for
the probable cause of the failure.
Registro:
2014-02-26 01:05:58 CET ERROR: function pg_catalog._final_mode(anyarray) does not exist
2014-02-26 01:05:58 CET STATEMENT: CREATE AGGREGATE "mode"("anyelement") (
SFUNC = "array_append",
STYPE = "anyarray",
INITCOND = '{}',
FINALFUNC = "pg_catalog"."_final_mode"
);
O erro significa que a atualização com falha foi deixada
/var/lib/postgresql/9.3/main/
em um estado inutilizável, quebrada e meio atualizada. Para tentar atualizar novamente, você deve primeiro removê-lo e, em seguida, recriá-lo executandoinitdb
como fez para criá-lo pela primeira vez.Observe
pg_upgrade_dump_27132.log
epg_upgrade_server.log
veja por que a atualização falhou. Reexecutá-lo sem alterar nada provavelmente não fará nenhuma diferença.