pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sergey Koposov <skoposov@cmu.edu>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: pg_dump schema in pg11 without global permissions
Date: Tue, 23 Jul 2019 22:19:27 +0000
Message-ID: <1563920367.29206.91.camel@cmu.edu> (raw)

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. 

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


view thread (14+ messages)  latest in thread

Message-ID: <1563920367.29206.91.camel@cmu.edu>
Permalink:  ../1563920367.29206.91.camel@cmu.edu/
Also on:    postgresql.org/message-id/1563920367.29206.91.camel@cmu.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: skoposov@cmu.edu
  Subject: Re: pg_dump schema in pg11 without global permissions
  In-Reply-To: <1563920367.29206.91.camel@cmu.edu>
  References: <1563920367.29206.91.camel@cmu.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox