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 1olVU5-00031J-Kw for pgsql-general@arkaria.postgresql.org; Thu, 20 Oct 2022 13:21:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1olVT5-0000aG-Gq for pgsql-general@arkaria.postgresql.org; Thu, 20 Oct 2022 13:20:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olVT5-0000a4-3t for pgsql-general@lists.postgresql.org; Thu, 20 Oct 2022 13:20:15 +0000 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1olVT2-0000Sj-4S for pgsql-general@lists.postgresql.org; Thu, 20 Oct 2022 13:20:14 +0000 Received: by mail-ot1-x32f.google.com with SMTP id z11-20020a05683020cb00b00661a95cf920so11375754otq.5 for ; Thu, 20 Oct 2022 06:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OkeS+luLaD2Fy/6IKs1xpOTKYM5kE1c2LhU02pA0d7E=; b=Bg3LyX7b/0qYZlxOEca0NoI96uJ+WTZk9cESQSX1QxTWQ6YaS9z81rUFEVMJprkzmZ M/k1EDsaGm9YbAiAbEWxb+SP0hfFWItBvClYLXwF4eQlvhUq+z9iZvQbV5mwxxua3aMA UMEVWPeUgnVvpAhHZN7Qb3xRd5lrM0MqXugd2cHlnlid7Olv04Nor/qXsdEr6X6eQCWe Mb9y2rGCRVrJSv7OLJ5AfrVR61xu92qNOLCHkoDgrRFT4qeCIsn2eEwwkpmfgPtRnB74 /KcxO/hIG/10V/obf0wAfE2b0ycRMsDF4m11WeK4TAHirL3NK0fgi3Fngsbfm8oUBDC7 cwtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OkeS+luLaD2Fy/6IKs1xpOTKYM5kE1c2LhU02pA0d7E=; b=71rqKwvd22171lr2MVOP8e77HdtHFwV5e9AHeJpjzQOgr9m2wJK9ZfEfW0V3+olaSg QPQXSuCVac0n/7LAVHX6dsgAy0jE0gyxvlwu+Wtn4Zl6RIXgak4aTC/d0/oonBAGrpXw Wm5PtHpVwbEa+37rRREivRdFK7NCuxBPsJ1FryC8QToDuSf+DexchLmcj4pVXqY9hI90 YeXOuop0TZrGMAQFzWaeGSvJjbCBBX16lIKmfoxslEgt3Tt+ttK8yl+K2VxUjETzSYJ3 DAgo7C91q+RrKa1a8JLdJjT7zQXstZEx46TY+zvAzH/4gXe42E8FfbgAyNpu33n3kYO/ zoLw== X-Gm-Message-State: ACrzQf0r0jEEnpi1uxshnZyIabfkzMVAUi2sYQNJ7VySQj6uIe0XOYww vteY5S41WSgQDD4JB9jBkJJP92VwYNE= X-Google-Smtp-Source: AMsMyM4e7etzQPSKjfsfzUbyLNEKSu+ZT7NXyyfHgCFXD2MO2d/aP2IfzNhQJPKUm4A+QK/1Y+x/IQ== X-Received: by 2002:a05:6830:9ca:b0:661:2ba:9b69 with SMTP id y10-20020a05683009ca00b0066102ba9b69mr6853017ott.240.1666272010892; Thu, 20 Oct 2022 06:20:10 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id l30-20020a0568302b1e00b00661cff5cdebsm8255005otv.19.2022.10.20.06.20.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Oct 2022 06:20:10 -0700 (PDT) Message-ID: Date: Thu, 20 Oct 2022 08:20:09 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: pg_restore 12 "permission denied for schema" errors Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <287717df-88e2-a4a5-2025-260c39662bca@gmail.com> <40fd91d2-d981-2f44-4d58-a3f08a9448fb@familie-gard.de> <2980993.1666242738@sss.pgh.pa.us> From: Ron In-Reply-To: <2980993.1666242738@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/20/22 00:12, Tom Lane wrote: > Frank Gard writes: >> Am 20.10.22 um 02:58 schrieb Ron: >>> pg_restore -v --create --clean --jobs=`nproc` -Fd --dbname=template1 $DB >> What database do you want to restore your data into? As far as I know your 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. I ran "pg_dumpall --globals-only --no-role-passwords" on the source instance, and applied it to the new instance before doing the pg_restore.  If I hadn't done that, pg_restore would have thrown errors on all the GRANT and ALTER TABLE ... OWNER TO statements embedded in the backup. -- Angular momentum makes the world go 'round.