Re: pg_dump schema in pg11 without global permissions

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Sergey Koposov <skoposov(at)cmu(dot)edu>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump schema in pg11 without global permissions
Date: 2019-07-23 23:36:27
Message-ID: d6361e01-3f37-d2c5-e329-e4238c6cb518@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-07-24 00:10:58 Re: pg_dump schema in pg11 without global permissions
Previous Message Sergey Koposov 2019-07-23 23:32:48 Re: pg_dump schema in pg11 without global permissions