Обсуждение: Issue in pg_update

Поиск
Список
Период
Сортировка

Issue in pg_update

От
Yuriy Tereshchuk
Дата:
$ /usr/local/bin/pg_upgrade -b /home/astro/Postgresql9.1.4/bin -B /usr/loca=
l/bin -d /usr/local/pgsql/data.old -D /usr/local/pgsql/data96
Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
Checking database user is the install user                  ok
Checking database connection settings                       ok
Checking for prepared transactions                          ok
Checking for reg* system OID user data types                ok
Checking for contrib/isn with bigint-passing mismatch       ok
Checking for roles starting with 'pg_'                      ok
Checking for invalid "line" user columns                    ok
Creating dump of global objects                             ok
Creating dump of database schemas
                                                            ok
Checking for presence of required libraries                 ok
Checking database user is the install user                  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 and epoch for new cluster       ok
Deleting files from new pg_multixact/offsets                ok
Setting oldest multixact ID on new cluster                  ok
Resetting WAL archives                                      ok
Setting frozenxid and minmxid counters in new cluster       ok
Restoring global objects in the new cluster                 ok
Restoring database schemas in the new cluster
  postgres
*failure*

Consult the last few lines of "pg_upgrade_dump_11913.log" for
the probable cause of the failure.
Failure, exiting
$ vim pg_upgrade_dump_11913.log



pg_restore: creating VIEW "public.pg_prepared_statements"
pg_restore: creating VIEW "public.pg_prepared_xacts"
pg_restore: creating VIEW "public.pg_roles"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 162; 1259 17237 VIEW pg_ro=
les astro
pg_restore: [archiver (db)] could not execute query: ERROR:  column pg_auth=
id.rolcatupdate does not exist
LINE 14: ...thid"."rolcreaterole", "pg_authid"."rolcreatedb", "pg_authid...
                                                              ^
    Command was:
-- For binary upgrade, must preserve pg_type oid
SELECT pg_catalog.binary_upgrade_set_next_pg_type_oid('17239'::pg_catalog..=
..

Re: Issue in pg_update

От
Tom Lane
Дата:
Yuriy Tereshchuk <YTereshchuk@lohika.com> writes:
> $ /usr/local/bin/pg_upgrade -b /home/astro/Postgresql9.1.4/bin -B /usr/l=
ocal/bin -d /usr/local/pgsql/data.old -D /usr/local/pgsql/data96
> ...
> pg_restore: creating VIEW "public.pg_prepared_statements"
> pg_restore: creating VIEW "public.pg_prepared_xacts"
> pg_restore: creating VIEW "public.pg_roles"
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 162; 1259 17237 VIEW pg=
_roles astro
> pg_restore: [archiver (db)] could not execute query: ERROR:  column pg_a=
uthid.rolcatupdate does not exist
> LINE 14: ...thid"."rolcreaterole", "pg_authid"."rolcreatedb", "pg_authid=
...
>                                                               ^

Your 9.1 installation seems to have copies in the public schema of a bunch
of system views --- we can see three of them in this log excerpt, and I'm
betting there are more.  There is no mechanism that would automatically
update those copies to be correct for the new database version, and this
failure is occurring precisely because the 9.1 version of pg_roles is
incorrect for 9.6.  I'd suggest dropping all of those views in the source
installation --- why would you need them, anyway?  The originals in
pg_catalog should suffice.

            regards, tom lane