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 1omMdq-0004K3-Ed for pgsql-general@arkaria.postgresql.org; Sat, 22 Oct 2022 22:06:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1omMdp-0001Fy-06 for pgsql-general@arkaria.postgresql.org; Sat, 22 Oct 2022 22:06:53 +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 1omMdo-0001Fp-Ku for pgsql-general@lists.postgresql.org; Sat, 22 Oct 2022 22:06:52 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1omMdl-0003SY-DP for pgsql-general@lists.postgresql.org; Sat, 22 Oct 2022 22:06:52 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 21EDB32001BB; Sat, 22 Oct 2022 18:06:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sat, 22 Oct 2022 18:06:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1666476404; x= 1666562804; bh=6JTCoG71CKKUk7Ysd1/7FpwNqZVbWeqoS/53U/hkPac=; b=q JmMgCPPF52bu/waGgYhl8/s6n5pU81+dXKo+vKwhzCxo4dlIf0EDwVxSFV0k7mAt yJjOE1j6FayIv985LL991E9C6qqh4yBP4JL8QN9yHR6ucn71boDPOQPufuN87nBh feYlCOfRybKGKbQQtCYLEgxTxL8p1lpaTfbDcIJO/847+bs2Huy9FXcfVdigkIg4 oYi33o8+YBzvSRfj3eaipI2zYYs0BChLhVfdgGhQt2CJVkiy+WQcYH8hY9fKcoLE 5hL9Sa+IGgz7fUUMveUOFLWgS6g8f2lA5UnhdCgrERU3zz5chqyWbmPZoOBzTNni J+A25zEVNo0RE3pmODoUA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1666476404; x=1666562804; bh=6 JTCoG71CKKUk7Ysd1/7FpwNqZVbWeqoS/53U/hkPac=; b=sE/eBvXM3ZPvNidS5 NxS9sniRxkElR12HJdTtlQWGouj8VvHNgxmmYBorlJS2ZrHQ6tLa9ejPjkvQ8yNS u1A4zzQhYWqQO1mHknmLR4lI4Yy5PC+UgE5EA9SyDSuwza8rJeDxPmntSlOZsYsn SRJmkVve6kQ8PLG3c9lgXT7sBqY9lKazDV8s1n5tsic3hDcH0QJGtW3GZDKwXhUr tH8dvj0ToYtj5Im3Fwsbeh+6Qxdnr2TAzoDO7BQ3dwbPWT/5vw19gyRyPbdEe93K CFhEiRnKvPvzG9vcd544CqzlCQhpxYud3dcQ447lKo12uwmn2M+LzvcBR+sKbjtd 1y31Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgedtuddgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtje ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepheelkeejue elhedvieffheetfefhjeekkeefudehgffhtdejvdfhgeegledvfeegnecuffhomhgrihhn pegrmhgriihonhgrfihsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtgho mh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 22 Oct 2022 18:06:43 -0400 (EDT) Message-ID: Date: Sat, 22 Oct 2022 15:06:43 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: pg_restore 12 "permission denied for schema" errors Content-Language: en-US To: Ron , 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> <612cf1c4-1f2d-f068-d6cf-54b98bbeb646@gmail.com> <727e6a26-4b58-0aea-a701-9671b8935410@aklaver.com> <119d108c-0669-a15d-2afe-3c4116130118@gmail.com> <4da803e6-407c-19ee-53a0-618c6465ab81@gmail.com> <7d3c6371-b963-1c22-42e3-ecbff8e72f28@gmail.com> From: Adrian Klaver In-Reply-To: <7d3c6371-b963-1c22-42e3-ecbff8e72f28@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/22/22 14:45, Ron wrote: > On 10/22/22 16:29, Adrian Klaver wrote: >> To pseudo for me. >> >> What file exactly is: >> >> pg_restore --jobs=X --no-owner $NEWDB >> >> restoring? >> >> And how was that file created? >> >> Knowing this might help get at why the more straight forward method >> does not work. > > This is what I ran to restore the database: > export PGHOST=${RDSENV}.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com > cd /migrate/TASK001793786/2022-10-19b > NEWDB=sides > pg_restore -v --create --clean --no-owner --jobs=`nproc` -Fd > --dbname=template1 $NEWDB > psql $NEWDB -f all_OWNER.sql > psql $NEWDB -f all_GRANT.sql > > The name of the database is "sides", and there's a directorynamed > "sides" under /migrate/TASK001793786/2022-10-19b. Aah, I forgot about the -Fd, now it makes more sense. To get past the --jobs induced error required the addition of --no-owner and then adding owners and grants after the main restore. What was the pg_dump command that produced /migrate/TASK001793786/2022-10-19b/sides ? > >>> >>>> >>>>> psql $NEWDB -f all_OWNER.sql >>>>> psql $NEWDB -f all_GRANT.sql >>>>> >>>>> This is, of course, why we need to test the backup/restore process. >>>>> >>>> >>> >> > -- Adrian Klaver adrian.klaver@aklaver.com