Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olNrF-0004lr-UB for pgsql-general@arkaria.postgresql.org; Thu, 20 Oct 2022 05:12:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1olNrE-00017P-IQ for pgsql-general@arkaria.postgresql.org; Thu, 20 Oct 2022 05:12:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olNrE-00017E-7x for pgsql-general@lists.postgresql.org; Thu, 20 Oct 2022 05:12:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olNr9-0006pF-Hp for pgsql-general@lists.postgresql.org; Thu, 20 Oct 2022 05:12:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 29K5CIYm2980994; Thu, 20 Oct 2022 01:12:18 -0400 From: Tom Lane To: Frank Gard cc: Ron , pgsql-general@lists.postgresql.org Subject: Re: pg_restore 12 "permission denied for schema" errors In-reply-to: <40fd91d2-d981-2f44-4d58-a3f08a9448fb@familie-gard.de> References: <287717df-88e2-a4a5-2025-260c39662bca@gmail.com> <40fd91d2-d981-2f44-4d58-a3f08a9448fb@familie-gard.de> Comments: In-reply-to Frank Gard message dated "Thu, 20 Oct 2022 07:03:00 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2980992.1666242738.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 20 Oct 2022 01:12:18 -0400 Message-ID: <2980993.1666242738@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Frank Gard writes: > Am 20.10.22 um 02:58 schrieb Ron: >> pg_restore -v --create --clean --jobs=3D`nproc` -Fd --dbname=3Dtemplate= 1 $DB > What database do you want to restore your data into? As far as I know yo= ur pg_restore command would import the data into template1, right? No --- my ears went up about that too, but he's using --create. So template1 is just the springboard for the initial connection in which CREATE DATABASE will be issued. My guess is that there's something inconsistent between source and target installations about roles and role-privilege grants. We don't have enough details to do more than guess, though. regards, tom lane