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 1omHrm-0006Pg-Na for pgsql-general@arkaria.postgresql.org; Sat, 22 Oct 2022 17:00:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1omHrl-0006j6-16 for pgsql-general@arkaria.postgresql.org; Sat, 22 Oct 2022 17:00:57 +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 1omHrj-0006iw-1h for pgsql-general@lists.postgresql.org; Sat, 22 Oct 2022 17:00:56 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1omHre-0007bX-K5 for pgsql-general@lists.postgresql.org; Sat, 22 Oct 2022 17:00:53 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 677CA3200907; Sat, 22 Oct 2022 13:00:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 22 Oct 2022 13:00:48 -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=1666458048; x= 1666544448; bh=mdNLg7cNfOXl4bQEKZZzTjWjFRo1t96UerCvxHPBhCE=; b=S 5kxgcuo6rwdOLxY/8bDSdF7EX6RU5Fl12dJDWKrcaMCQui0ST5p2HKAhvag2R58D 8IK0PJQaxTvfGYuZP/q14VUfqEQJhKw23iZcv4YGORWTf5UJarW83JPGxiMsVmad rCCVvcIGP/yxFwIEX4b/VZRBU1SzyGDJriZmfIqaxYNGKwzVjjmF7l1U92AvC8gc HGdYeTw2OgBoX1t9ntEz/OZtVviw2kXx/MQOzRu7CxABDdT2yJcP94QsQ2Dq1m8Y QdFFy1fW7ALM1ZMnojLDV482knuq7x4bRuNlxIYJA8AFQY0IbSskUrAg+6/Io88a ttpVGYMxNGyIwWwc8XJkA== 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=1666458048; x=1666544448; bh=m dNLg7cNfOXl4bQEKZZzTjWjFRo1t96UerCvxHPBhCE=; b=CizJk/9M8Zhnwc/Nh o1rEnyZf8W7omhU82QZVZjYpqZtoiFOgdIE4+JCySY2RqDQzNCPfFkgMQCAtdnE+ Yz7UT22bNNanDfl1jq+cmyDGXUNAC6agd7oQQQRZCGZu11E6hfM66R97bHPMuIvd hVtVpWtNYd2VzNJYx5bbZm9HgN288rXbISjGYP1laS9vk0NNMpO8GQc2z1ssrxCB tuovdZXi/Eis36Pzx9BS4GJYhamPqlcbp3yluVKxeifH+PgTGQbyHjg4kUA8X/UY UEknnqB+VeOQAjJd8FNTxuaOAZUXrP+I08TUS/jHU3EtQbtDWoJ+jGZTj2YhVriF qI0kA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgedttddguddtjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesth ejredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeevvdekie fhudfhhfdtkeelgeffudeigfetjeegfffghfetfeelledugfelleegveenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrg hvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 22 Oct 2022 13:00:47 -0400 (EDT) Message-ID: Date: Sat, 22 Oct 2022 10:00:46 -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> From: Adrian Klaver In-Reply-To: <119d108c-0669-a15d-2afe-3c4116130118@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 09:41, Ron wrote: > On 10/22/22 11:20, Adrian Klaver wrote: >> On 10/20/22 14:34, Ron wrote: >>> 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: >> > I was afraid you were going to say that. > > The work-around is to: > pg_dump $SRCDB --schema-only | grep -e '^\(GRANT|REVOKE\)' > all_GRANT.sql > pg_dump $SRCDB --schema-only | grep OWNER > all_OWNER.sql > pg_restore --jobs=X --no-owner $NEWDB The above and below have me confused. What is $NEWDB? In above it seems to be a file and below a database name. > 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