Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iz13A-0007kp-Ck for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Feb 2020 16:27:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iz139-0004Ke-2a for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Feb 2020 16:27:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iz138-0004HR-NY for pgsql-bugs@lists.postgresql.org; Tue, 04 Feb 2020 16:27:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iz136-0004If-D6 for pgsql-bugs@lists.postgresql.org; Tue, 04 Feb 2020 16:27:41 +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 014GRcKb007311; Tue, 4 Feb 2020 11:27:39 -0500 From: Tom Lane To: 270246512@qq.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16243: non super user take pg_restore found some errors. In-reply-to: <16243-1cfc4ec17c2664d9@postgresql.org> References: <16243-1cfc4ec17c2664d9@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 04 Feb 2020 06:18:01 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <7309.1580833658.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 04 Feb 2020 11:27:38 -0500 Message-ID: <7310.1580833658@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > When take the pg restore, both backup action and restore use non-super r= ole > user =E2=80=9Ccm=E2=80=9D which is the owner of the DB. During pg_restor= e, the log show some > errors such as "could not execute query: ERROR: must be owner of extens= ion > plpgsql", "could not execute query: ERROR: must be owner of extension > plpgsql". I have some confusion. Are they correct behavior? If not, how = to > avoid them? thanks in advance. This is expected behavior in v10. In later versions (I forget if this was changed in v11 or v12), we rearranged the duties of pg_dump so that it won't try to drop and recreate the plpgsql extension. That wasn't an entirely backwards-compatible change though, so it wasn't back-patched. regards, tom lane