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 1omM3s-0002ng-4l for pgsql-general@arkaria.postgresql.org; Sat, 22 Oct 2022 21:29:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1omM3p-0001Vh-RW for pgsql-general@arkaria.postgresql.org; Sat, 22 Oct 2022 21:29:41 +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 1omM3o-0001VX-2f for pgsql-general@lists.postgresql.org; Sat, 22 Oct 2022 21:29:41 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1omM3k-00015c-PN for pgsql-general@lists.postgresql.org; Sat, 22 Oct 2022 21:29:38 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 72AA23200907; Sat, 22 Oct 2022 17:29:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 22 Oct 2022 17:29:34 -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=1666474174; x= 1666560574; bh=JrpibHw8OV0q8K0L92UnqM1cDftHq/BP0xWXWnHBkk8=; b=O 6ESxaP4S+DWxNquCc36N56omHy1xvdHd14seggJlPTmeDlIdOBztE/pb+INv8kPh kNtWObC1cC/4xaa5YaEZVAlE1m0IHHcc0p/rCHDopxRXj+v1Mb2pIVtjJXSrLeIW B/vwK6Q/rFUTOIyXdnHBCPWLjQJ/xt3khzwFKqbbVeDxKBIYi9d50l02yC6jYZ0t dcEZ7485PvZ+W40187yQjp7e+GtVo52Genspz+nmELgwWuJCGXNsxFDr6H4tHFg5 2OtqoFEj+xBSm6U9gf44UglowMdgJJvtqn0nkvvlRv2tJK+erfphwE1h22ETSexU I20iRkfHqsPrm4ZF5azGQ== 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=1666474174; x=1666560574; bh=J rpibHw8OV0q8K0L92UnqM1cDftHq/BP0xWXWnHBkk8=; b=nk7EU8MCzf2us+Nmb e2Ts5CfvdB7HFWJ+OE0Oro+5VLWtPyBMiTrO9p1KZyVx7brQIBGMYSEO6+vOBVw/ 9QDmrV2Ll/47UWTafY8G+IX8R4CD1Xs4RT4JngiaoUEzA1uYh89vjvnzcp2Ac4vQ Cm1mbOrDoESjRhACY/u82JdqVkaFlCUPG60LTEvBNhy76wLwC0OrX6GEDMGKmEj5 ICHlh/qO9gNZNYztiaTyt4mhGl6bIS8Lfa/HJ6JQf4VSUlUxcA9S1fAedP/LHuWX qe/4agstedW3USmTrjroyKD4CryrnviZ4QSw5KDj7gfl0tbxOsc2P+mliG0xzvQD mLspQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgedttddgudeitdcutefuodetggdotefrod 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 17:29:33 -0400 (EDT) Message-ID: Date: Sat, 22 Oct 2022 14:29:32 -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 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> Content-Language: en-US From: Adrian Klaver In-Reply-To: <4da803e6-407c-19ee-53a0-618c6465ab81@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:02, Ron wrote: > On 10/22/22 12:00, Adrian Klaver wrote: >> 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. > > Consider it pseudo-code. 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. > >> >>> 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