Обсуждение: Upgrade failure attempting to go to 12.0

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

Upgrade failure attempting to go to 12.0

От
Karl Denninger
Дата:

Coming from 10.1.

I think I've seen this before, but I can't figure out where the issue is.  The original database dates to way, way back when contrib/tsearch2 was a loaded module instead of the functionality being part of the base system, and I suspect vestigal pieces are involved.

When I try to run the upgrade I get this failure when pg_upgrade gets to template1:

pg_restore: creating FUNCTION "public.pgp_sym_decrypt("bytea", "text")"
pg_restore: creating FUNCTION "public.pgp_sym_decrypt("bytea", "text", "text")"
pg_restore: creating FUNCTION "public.pgp_sym_decrypt_bytea("bytea", "text")"
pg_restore: creating FUNCTION "public.pgp_sym_decrypt_bytea("bytea", "text", "te
xt")"
pg_restore: creating FUNCTION "public.pgp_sym_encrypt("text", "text")"
pg_restore: creating FUNCTION "public.pgp_sym_encrypt("text", "text", "text")"
pg_restore: creating FUNCTION "public.pgp_sym_encrypt_bytea("bytea", "text")"
pg_restore: creating FUNCTION "public.pgp_sym_encrypt_bytea("bytea", "text", "te
xt")"
pg_restore: creating FUNCTION "public.querytree("tsquery")"
pg_restore: creating FUNCTION "public.setweight("tsvector", "char")"
pg_restore: creating FUNCTION "public.strip("tsvector")"
pg_restore: creating FUNCTION "public.ts_debug("text")"
pg_restore: creating FUNCTION "public.tsq_mcontained("tsquery", "tsquery")"
pg_restore: creating FUNCTION "public.tsq_mcontains("tsquery", "tsquery")"
pg_restore: creating FUNCTION "public.tsquery_and("tsquery", "tsquery")"
pg_restore: creating FUNCTION "public.tsquery_not("tsquery")"
pg_restore: creating FUNCTION "public.tsquery_or("tsquery", "tsquery")"
pg_restore: creating OPERATOR FAMILY "public.gin_tsvector_ops"
pg_restore: creating OPERATOR CLASS "public.gin_tsvector_ops"
pg_restore: creating OPERATOR FAMILY "public.gist_tp_tsquery_ops"
pg_restore: creating OPERATOR CLASS "public.gist_tp_tsquery_ops"
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 1579; 2616 17787 OPERATOR CLASS gist_tp_tsquery_ops p
gsql
pg_restore: error: could not execute query: ERROR:  function gtsquery_decompress
(internal) does not exist
Command was: CREATE OPERATOR CLASS "public"."gist_tp_tsquery_ops"
    FOR TYPE "tsquery" USING "gist" FAMILY "public"."gist_tp_tsquery_ops" AS
    STORAGE bigint ,
    OPERATOR 7 @>("tsquery","tsquery") ,
    OPERATOR 8 <@("tsquery","tsquery") ,
    FUNCTION 1 ("tsquery", "tsquery") "gtsquery_consistent"("internal","internal
",integer,"oid","internal") ,
    FUNCTION 2 ("tsquery", "tsquery") "gtsquery_union"("internal","internal") ,
    FUNCTION 3 ("tsquery", "tsquery") "gtsquery_compress"("internal") ,
    FUNCTION 4 ("tsquery", "tsquery") "gtsquery_decompress"("internal") ,
    FUNCTION 5 ("tsquery", "tsquery") "gtsquery_penalty"("internal","internal","
internal") ,
    FUNCTION 6 ("tsquery", "tsquery") "gtsquery_picksplit"("internal","internal"
) ,
    FUNCTION 7 ("tsquery", "tsquery") "gtsquery_same"(bigint,bigint,"internal");

I *think* this is from vestigal parts of the old tsearch2 components..... but I can't find them in the old template1 database (am I looking in the right place?)

I suspect these are also in all the other databases in the cluster, and thus I need to kill them for each of those... but I have to find 'em first!

Thanks in advance (please be specific -- this one has me stumped!)

--
Karl Denninger
karl@denninger.net
The Market Ticker
[S/MIME encrypted email preferred]
Вложения

Re: Upgrade failure attempting to go to 12.0

От
Tom Lane
Дата:
Karl Denninger <karl@denninger.net> writes:
> I think I've seen this before, but I can't figure out where the issue
> is.  The original database dates to way, way back when contrib/tsearch2
> was a loaded module instead of the functionality being part of the base
> system, and I suspect vestigal pieces are involved.

Yeah, that's what it looks like.  This:

> Command was: CREATE OPERATOR CLASS "public"."gist_tp_tsquery_ops"

is part of the old tsearch2 stuff, and you'll need to remove it from
the v10 installation before you can upgrade.

What I can't tell from this evidence is whether you'd ever converted
tsearch2 into an actual extension --- if you had, then "drop extension"
would be enough to get rid of it.  Otherwise, you need to consult a copy
of the old "uninstall_tsearch2.sql" script to find out what you ought to
get rid of.

If you have user tables or indexes that depend on the old tsearch2
objects, things get more complex :-( --- you'd want to update those
to depend on the newer core datatype and index opclasses before
you clean out the old ones.

            regards, tom lane