pg_dump schema in pg11 without global permissions - Mailing list pgsql-general

From Sergey Koposov
Subject pg_dump schema in pg11 without global permissions
Date
Msg-id 1563920367.29206.91.camel@cmu.edu
Whole thread Raw
Responses Re: pg_dump schema in pg11 without global permissions
List pgsql-general
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
inthe 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,
noton the database. 
 

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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Query plan: SELECT vs INSERT from same select
Next
From: Adrian Klaver
Date:
Subject: Re: pg_dump schema in pg11 without global permissions