Re: Schema dump

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Schema dump
Дата
Msg-id d70458b1-8059-f5c0-cbf6-9410e00a1e23@aklaver.com
обсуждение исходный текст
Ответ на Re: Schema dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Schema dump
Список pgsql-general
On 1/2/20 5:47 AM, Tom Lane wrote:
> Sonam Sharma <sonams1209@gmail.com> writes:
>> I took a schema dump using : pg_dump -n schema dbname .
>> When I restored this , it doesn't contain the constraints and indexes. Can
>> someone please help how to take a dump including all
> 
> Hmph ... works for me.  Where by "works", I mean "the dump contains
> constraints and indexes belonging to tables in the specified schema,
> and not any others".  Maybe you could provide a little more detail?
> 
> (One thing I notice is that the dump doesn't contain a "CREATE
> SCHEMA schema" command, so you have to do that manually before
> you restore.  I guess this fits with the definition of the switch
> as selecting objects *in* the named schema, but it's still a
> possible gotcha.)

Caffeine kicked in, now I remember how the above happens:

pg_restore -n utility -f pgrestore_utility.sql /production_12.out

In pgrestore_utility.sql there is no CREATE SCHEMA.

This came up in a previous thread:

https://www.postgresql.org/message-id/6234.1569941612%40sss.pgh.pa.us

> 
>             regards, tom lane
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Schema dump
Следующее
От: Sonam Sharma
Дата:
Сообщение: Re: Schema dump