Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uQMUh-009Rr7-Ny for pgsql-general@arkaria.postgresql.org; Sat, 14 Jun 2025 08:44:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uQMUf-007jKr-Nu for pgsql-general@arkaria.postgresql.org; Sat, 14 Jun 2025 08:44:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uQMUf-007jKW-9X for pgsql-general@lists.postgresql.org; Sat, 14 Jun 2025 08:44:05 +0000 Received: from mail.w13.tutanota.de ([185.205.69.213]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uQMUb-001vfQ-1W for pgsql-general@lists.postgresql.org; Sat, 14 Jun 2025 08:44:02 +0000 Received: from tutadb.w10.tutanota.de (w10.api.tuta.com [IPv6:fd:ac::d:10]) by mail.w13.tutanota.de (Postfix) with ESMTP id 9FC08960B71B for ; Sat, 14 Jun 2025 10:42:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1749890579; s=s1; d=tutanota.de; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=77SvvrW1il5tbQ1jfCOeqZUptbLLniYpEYAIl3747us=; b=wafXbKAOJpPKmKfZd1I58k7/+d7hHLv9LAt52eiCSzfgrRSQJTWX8GZ2hNkZ1Dtk NMI+seY81cJP9NgjlXZL2JLEhp5arsIQ7vQ4M4Z8C7DbyNudUXoByUssUE9E1R0ISRx Mg2IKl21vR6Y+rZ1PuMOMDVTgKpYvopWkYir0nFY0y6tZQ2XpbC/g8pdIJaSZkSHcnw cmCOeZBO2fV/uqIQeIGxUy25VHD7LLtI9BTJJdy9xieTLye4jyrRE20RnjBMk8YbrMT HBMMYz+WaPYGXnAonbo2tZat71ql+xH1qPpyLs9ADzHnSC7ctTEWK7btR3Ejx4wPPCC pCYlLogA3w== Date: Sat, 14 Jun 2025 10:42:59 +0200 (CEST) From: Rachel Roch To: Adrian Klaver Cc: Tom Lane , Pgsql General Message-ID: In-Reply-To: References: <1407215.1749838987@sss.pgh.pa.us> Subject: Re: pg_restore ERROR: permission denied to change default privileges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 13 Jun 2025, 20:13 by adrian.klaver@aklaver.com: > > To get at an editable script you can do something like: > > pg_restore -f my_database_txt.sql my_database.dump > > This will give you a plain text version of the dump that you can feed bac= k to psql to load into remote database. > Thanks Adrian ! I had thought maybe maybe I could do a "pg_restore -l=C2=A0my_database.dump= " and ignore the relevant line using whatever the other flag is, but sadly = there doesn't appear to be enough flexibility, i.e.=C2=A0 pg_restore -l=C2=A0my_database.dump | fgrep -F postgres gives: 2067; 826 16607 DEFAULT ACL public DEFAULT PRIVILEGES FOR TABLES postgres But pg_restore -l=C2=A0my_database.dump | fgrep -F=C2=A0my_database_ro gives nothing.=C2=A0 =C2=A0:( So either your solution or Tom's "just ignore it" sound like they'll work.