pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Sergey Koposov <skoposov@cmu.edu>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: pg_dump schema in pg11 without global permissions
Date: Tue, 23 Jul 2019 16:36:27 -0700
Message-ID: <d6361e01-3f37-d2c5-e329-e4238c6cb518@aklaver.com> (raw)
In-Reply-To: <1563923841.29206.106.camel@cmu.edu>
References: <1563920367.29206.91.camel@cmu.edu>
	<3c27ead3-134a-d27d-1097-684af2e6a811@aklaver.com>
	<1563920629.29206.93.camel@cmu.edu>
	<eb0004eb-e415-7320-ad6b-fc36c49c3518@aklaver.com>
	<1563921764.29206.97.camel@cmu.edu>
	<bde193d8-ebeb-502b-2801-e347e4557197@aklaver.com>
	<1563922734.29206.103.camel@cmu.edu>
	<7bc24eb3-40a7-f402-db03-3b9c00eb1751@aklaver.com>
	<1563923841.29206.106.camel@cmu.edu>

On 7/23/19 4:17 PM, Sergey Koposov wrote:

> 
> For some reason I see when I just have
> a command  like this it doesnt' have a grant connect on database
> ~/soft/pgsql_install/bin/pg_dump -U skoposov -h localhost -n xx  --no-tablespaces test1
> but when I add  '-Fc' flag to pg_dump, I can see 'grant connect' inside the output (interdispersed with binary stuff)
> 
> I don't get it

As Tom explained the custom format will include a lot of information 
that you can retrieve later or not. For this case:

https://www.postgresql.org/docs/11/app-pgdump.html

"-C
--create

     Begin the output with a command to create the database itself and 
reconnect to the created database. (With a script of this form, it 
doesn't matter which database in the destination installation you 
connect to before running the script.) If --clean is also specified, the 
script drops and recreates the target database before reconnecting to it.

     With --create, the output also includes the database's comment if 
any, and any configuration variable settings that are specific to this 
database, that is, any ALTER DATABASE ... SET ... and ALTER ROLE ... IN 
DATABASE ... SET ... commands that mention this database. Access 
privileges for the database itself are also dumped, unless --no-acl is 
specified.

     This option is only meaningful for the plain-text format. For the 
archive formats, you can specify the option when you call pg_restore.
"

NOTE the last paragraph.




> 
>         S
> 
>>>
>>>
>>>
>>>          S
>>>


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (14+ messages)  latest in thread

Message-ID: <d6361e01-3f37-d2c5-e329-e4238c6cb518@aklaver.com>
Permalink:  ../d6361e01-3f37-d2c5-e329-e4238c6cb518@aklaver.com/
Also on:    postgresql.org/message-id/d6361e01-3f37-d2c5-e329-e4238c6cb518@aklaver.com

 · 

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: adrian.klaver@aklaver.com, skoposov@cmu.edu
  Subject: Re: pg_dump schema in pg11 without global permissions
  In-Reply-To: <d6361e01-3f37-d2c5-e329-e4238c6cb518@aklaver.com>
  References: <1563920367.29206.91.camel@cmu.edu> <3c27ead3-134a-d27d-1097-684af2e6a811@aklaver.com> <1563920629.29206.93.camel@cmu.edu> <eb0004eb-e415-7320-ad6b-fc36c49c3518@aklaver.com> <1563921764.29206.97.camel@cmu.edu> <bde193d8-ebeb-502b-2801-e347e4557197@aklaver.com> <1563922734.29206.103.camel@cmu.edu> <7bc24eb3-40a7-f402-db03-3b9c00eb1751@aklaver.com> <1563923841.29206.106.camel@cmu.edu> <d6361e01-3f37-d2c5-e329-e4238c6cb518@aklaver.com>

* 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