Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hq3AK-0001bM-IY for pgsql-general@arkaria.postgresql.org; Tue, 23 Jul 2019 22:21:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hq3AJ-0007nd-El for pgsql-general@arkaria.postgresql.org; Tue, 23 Jul 2019 22:21:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hq3AH-0007nW-P7 for pgsql-general@lists.postgresql.org; Tue, 23 Jul 2019 22:21:47 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hq3AE-0007Sz-JN for pgsql-general@lists.postgresql.org; Tue, 23 Jul 2019 22:21:44 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9020B220C9; Tue, 23 Jul 2019 18:21:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 23 Jul 2019 18:21:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=l 4TI3ON36A/v3q7Bz3EfYFVYJpNJNWjLSnf76v8Hvhs=; b=KqbCGnWwOtO/0VUjK 5BQNWgUFRqntwauytcYIUzGTyOzIse9RDziVqi8t0zx3PZYwfdmtNfQjbichwgzC wBgTkYVZbKwP/g7rdTtDBYQPBqJXYl1FyoURT1vh163jXgCyc/2tZ6oIclDzvlW5 iA6evm98sN0DQ/1gO/4+Fxg/pWJMyqAxNi8m9Plrc0UWd9w6ijJ+1LZjLMZTA5W3 SHWsxSnYMNjhqDIvN8YSLtYJaUU6o8Pr1XPJeF6OrwHT5QW/YJDR2QsqCh2TL93D wCOfplSc9k4JMo3uEXiqDLxC3b4t6dhffi/2JfMPJLLX7zpDM9CdtElh4hIMk8dX zhGJw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=l4TI3ON36A/v3q7Bz3EfYFVYJpNJNWjLSnf76v8Hv hs=; b=mTO3/Lult0AWqUWSLhCoN02Tg9Se9cQd1OfobjC8VrZDgNyRkWndO4XNj zuJPvWe0LM+LH1aNnDDPXKqcICwmK+A2eKbAWxx5BHuDw0OY52N8EDoI5hXmnbfW TxyoxpBFrcMM+klPRyGDcdeBa6hheSbZ020mRiMzc6tOLcpzPYV994gGKETPmBn6 ahQl2vCg6/jHcndgfcnAfYWW4WOLGOQ+66kCgC18TTfxyYnIoo0SlIOieZYTwqoB mpWK88TBeATBZuMphkrGz493SGy3jQByTO0nDutk2/h6oJdssD7ZuDGTMYwpqVhN dXzvpGYWF/15Ru4d7Q7UFMQMcHI3A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrjeelgddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfkphepjeefrddvfeel rdduudejrddvfeeknecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrg hvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from ranger.suse (c-73-239-117-238.hsd1.wa.comcast.net [73.239.117.238]) by mail.messagingengine.com (Postfix) with ESMTPA id AFBD1380074; Tue, 23 Jul 2019 18:21:40 -0400 (EDT) Subject: Re: pg_dump schema in pg11 without global permissions To: Sergey Koposov , "pgsql-general@lists.postgresql.org" References: <1563920367.29206.91.camel@cmu.edu> From: Adrian Klaver Message-ID: <3c27ead3-134a-d27d-1097-684af2e6a811@aklaver.com> Date: Tue, 23 Jul 2019 15:21:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1563920367.29206.91.camel@cmu.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/23/19 3:19 PM, Sergey Koposov wrote: > Hi, > > I'm trying to copy a schema from one PG database (ver 11) to PG 10. > Previously the first database version was 9.6 and the way I did the copying was > > ssh -o Compression=no user@host '/opt/pgsql/bin/pg_dump --no-tablespaces -n schemaname -Fc  -U dbadmin dbname'  | pg_restore -U dbadmin -h localhost -1 -d dbnme > > However after migrating from PG 9.6 to 11, when I did the same thing as before, I started getting a bunch of commands in the dump like this > > GRANT CONNECT ON DATABASE dbname TO usernameXX; > > which don't work for me because the list of users is different between different machines. > It is clear that the change is related to the way pg_dump is implemented now in PG11 that global objects are dumped. > But the question is how do I duplicate the previous behaviour, i.e. Dump just the schema and permission on the schema, not on the database. https://www.postgresql.org/docs/11/app-pgdump.html -x --no-privileges --no-acl Prevent dumping of access privileges (grant/revoke commands). > > I do know that I could grep the dump, but that's very annoying when dumping hundreds of millions of rows. > > Thanks in advance for the help. > >       Sergey > -- Adrian Klaver adrian.klaver@aklaver.com