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 1oldBz-00038w-3I for pgsql-general@arkaria.postgresql.org; Thu, 20 Oct 2022 21:35:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oldBw-0005CI-BG for pgsql-general@arkaria.postgresql.org; Thu, 20 Oct 2022 21:35:04 +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 1oldBw-0005C6-08 for pgsql-general@lists.postgresql.org; Thu, 20 Oct 2022 21:35:04 +0000 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oldBr-0004E8-Ls for pgsql-general@lists.postgresql.org; Thu, 20 Oct 2022 21:35:02 +0000 Received: by mail-oo1-xc2d.google.com with SMTP id r15-20020a4abf0f000000b004761c7e6be1so162711oop.9 for ; Thu, 20 Oct 2022 14:34:59 -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=hfWJRa0QLTSs+KgsyGaPpP4qpqT3v96AVjXqfvuKlug=; b=LLg7P0z+Wh070DLxxSoYv54Bo4FaeAAMOjO4kOq2OfKnhtUKAcWJk02FjzoEAOaaWE sLiuDKsiMtAmfa0xC1Lbr+7UoszGtlQ4n63SJsPDszrPDJ4xb4+9Yb98KS8LpS6CnI4i IJpJGe7KjXxzHyR1eF50M9XxvgOhZvHc5rcUaXT5F1SBq3/W/6UzYf0/KRtqLPKleusz ksBZJzbzh6lRb4gKfUCCFi0k1mkkDcfylkg7c5ur44YhFfiNDG0xNOptfU6UvcaIqMll jNjpE3+rwMgcDvg0YMIm5ROIGW+wtiU3WCfwNaJ+XGUEORRtmOyga7C/FJ2AkV1cZnDD cxOA== 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=hfWJRa0QLTSs+KgsyGaPpP4qpqT3v96AVjXqfvuKlug=; b=I7a+js6aR5rOEeHvvSoPXHhmANp9/FUCWypsamBUtk7DN/S2LvSRBK59bDLrvEXGV/ Xi0TqZ5YIwX+YvKePYyFs24xgciY9a4/q5ewSXfKIh4/bXLCdvWgZjA1cXeG0sP++gCf 0UwE8nklfzg+oc/GsKhZnw5lH0KY68/DQFI0SisINoAEzl5f6Wbrv4DXnhaQ9aOmwjVA V33nx896kF2v8uUJwHWcRQPLHrP299csCZfjjOlQwcdT9XkuxWMWeiwmwm4Lro2UG7R8 9eFb9tDHTWyuz9pPwu9wQub50RFw9WYP0f4paw6Yd9K2C14U6GFMUSgK3YguFYv/+i/e bTZQ== X-Gm-Message-State: ACrzQf06wbL9ZyXMajmBEvVdFXNGYlF1cj0cHaFeC6p2NdLVWQejtj2z 7QD6PTbVZzgfBMzmNwldwIg= X-Google-Smtp-Source: AMsMyM6N34YSfPvuHUa+nTACgTokHybLFTyvh+UW44uX8+OtyvdXWv2XI/I1Qeb4y1Iw3WBVTEgyjw== X-Received: by 2002:a4a:5a84:0:b0:47f:8d6e:9706 with SMTP id v126-20020a4a5a84000000b0047f8d6e9706mr7318148ooa.98.1666301699009; Thu, 20 Oct 2022 14:34:59 -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 a5-20020a05680802c500b0034fd36e95bfsm406441oid.31.2022.10.20.14.34.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Oct 2022 14:34:58 -0700 (PDT) Message-ID: <612cf1c4-1f2d-f068-d6cf-54b98bbeb646@gmail.com> Date: Thu, 20 Oct 2022 16:34:57 -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: Adrian Klaver , 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: 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 10:02, Adrian Klaver wrote: > On 10/20/22 06:20, Ron wrote: >> 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. >> > > Some questions: > > 1) The backup was from a Postgres 12.x database using a version 12 or > higher instance of pg_backup? pg_dump and pg_restore are 12.11 from RHEL8. > 3) What if you run without --jobs? It runs without error.  Add "--jobs=2" and the errors appear. -- Angular momentum makes the world go 'round.