Re: pg_dump not dumping some schemas - Mailing list pgsql-admin

From Albe Laurenz
Subject Re: pg_dump not dumping some schemas
Date
Msg-id A737B7A37273E048B164557ADEF4A58B36617951@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to pg_dump not dumping some schemas  ("Guo, Yun" <YGuo@cvent.com>)
Responses Re: pg_dump not dumping some schemas
List pgsql-admin
Yun Guo wrote:
> I use this command to dump schema:
> pg_dump -s -n test polling_etl  > file.sql
> 
> However, the file.sql file includes creation of all the objects in schema test, but not the creation
> of test schema itself.
> I executed pg_dump as postgres user, the server and pg_dump are version 9.3.5. I suspect it’s missing
> some permissions, but not able to figure out what permissions are missing. Below is the permission on
> test schema:
> 
> polling_etl=# \dn+ test
>                 List of schemas
>  Name | Owner | Access privileges | Description
> ------+-------+-------------------+-------------
>  test | test  | test=UC/test     +|
>       |       | pb_writer=UC/test+|
>       |       | =U/test          +|
>       |       | postgres=U*C/test |
> 

It works on my 9.3.6 database:

$ pg_dump -p 1235 -s -n laurenz test|grep 'CREATE SCHEMA'
CREATE SCHEMA laurenz;

You don't need any permissions to dump a schema, everybody can read the information.

Could you double check with a "grep" or so that there is indeed no CREATE SCHEMA
in your dump?

Yours,
Laurenz Albe

pgsql-admin by date:

Previous
From: Scott Ribe
Date:
Subject: Re: PostgreSQL Dump based backup using pipe
Next
From: "Guo, Yun"
Date:
Subject: Re: pg_dump not dumping some schemas