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 A737B7A37273E048B164557ADEF4A58B36618A43@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to Re: 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.

>>> 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 |

> I tried again. It¹s still not dumping CREATE SCHEMA. And weirdly it would
> work for some other schemas in the same database.
> 
> -bash-4.1$ pg_dump -s -n test polling_etl | grep 'CREATE SCHEMA'
> -bash-4.1$ pg_dump -s -n test2 polling_etl | grep 'CREATE SCHEMA'
> CREATE SCHEMA test2;

That is disturbing.

Does the schema show up in a custom format dump?

pg_dump -s -n test -Fc polling_etl | pg_restore -l

Yours,
Laurenz Albe

pgsql-admin by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Warning when connecting from PSQL Command
Next
From: Thomas SIMON
Date:
Subject: Re: Performances issues with SSD volume ?