Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1es976-0004L4-HX for pgsql-general@arkaria.postgresql.org; Sat, 03 Mar 2018 15:30:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1es975-0005MJ-Iq for pgsql-general@arkaria.postgresql.org; Sat, 03 Mar 2018 15:30:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1es975-0005Ld-7x for pgsql-general@lists.postgresql.org; Sat, 03 Mar 2018 15:30:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1es971-0001id-JD for pgsql-general@lists.postgresql.org; Sat, 03 Mar 2018 15:30:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w23FUCRs030746; Sat, 3 Mar 2018 10:30:13 -0500 From: Tom Lane To: "=?gb18030?B?Um9nZXIgU3Vubnk=?=" <947035276@qq.com> cc: pgsql-general@lists.postgresql.org Subject: Re: pg_upgrade fails to restore function In-reply-to: References: Comments: In-reply-to "=?gb18030?B?Um9nZXIgU3Vubnk=?=" <947035276@qq.com> message dated "Sat, 03 Mar 2018 15:08:56 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <30743.1520091012.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 03 Mar 2018 10:30:12 -0500 Message-ID: <30744.1520091012@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "=3D?gb18030?B?Um9nZXIgU3Vubnk=3D?=3D" <947035276@qq.com> writes: > During the pg_upgrade from PostgreSQL 9.4 to PostgreSQL 10.0, the error=C2= =A1=C2=B1[archiver (db)] Error while PROCESSING TOC:=C2=A1=C2=B1 happened,= The upgrade failed. OS is RHEL 6.5 , The error is as below: > pg_restore: connecting to database for restorepg_restore= : creating pg_largeobject "pg_largeobject"pg_restore: creating pg_largeobj= ect_metadata "pg_largeobject_metadata"pg_restore: creating SCHEMA "bo_user= 0300"pg_restore: creating SCHEMA "d0007359_bex2018"pg_restore: creating SC= HEMA "d0007359_dan2014" ---- omit ---------- omit ---------- omit ------ = > pg_restore: creating PROCEDURE "zchuo_ult18.kp_delkakeihyo(character)" = > pg_restore: creating FOREIGN DATA WRAPPER "dblink_fdw" = > pg_restore: [archiver (db)] Error while PROCESSING TOC: > pg_restore: [archiver (db)] Error from TOC entry 470023; 2328 777028 FO= REIGN DATA WRAPPER dblink_fdw postgrespg_restore: [archiver (db)] could no= t execute query: ERROR: function dblink_fdw_validator(text[], oid) does n= ot exist = > Command was: CREATE FOREIGN DATA WRAPPER "dblink_fdw" VALIDATOR "dbli= nk_fdw_validator"; Is that really the first error, or did you "omit" some? What it looks like is that dblink_fdw_validator had previously failed to be created, probably because you don't have dblink.so installed in the destination database. Or maybe it's not the right version of dblink.so. regards, tom lane