Re: TR: Issue: --exclude-schema flag not working with pgrestore

Поиск
Список
Период
Сортировка
От ROCHER Julien
Тема Re: TR: Issue: --exclude-schema flag not working with pgrestore
Дата
Msg-id PR0P264MB04927B42E2CDD12982180587EDD59@PR0P264MB0492.FRAP264.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответ на TR: Issue: --exclude-schema flag not working with pgrestore  (ROCHER Julien <julien.rocher@emeria.eu>)
Список pgsql-bugs

Hi again,

 

I was wondering though, do you know why it is different from pgdump  -N behavior (Do not dump any schemas matching pattern) ?

 

 

Julien ROCHER

Développeur Team Data - Migration

 

Emeria Technologies

76-78 Avenue des Champs Elysées – 75008 Paris 

06 17 17 60 64

julien.rocher@emeria.eu

 

 

De : ROCHER Julien <julien.rocher@emeria.eu>
Date : mercredi, 11 janvier 2023 à 15:16
À : Julien Rouhaud <rjuju123@gmail.com>
Objet : Re: TR: Issue: --exclude-schema flag not working with pgrestore

Ok thank you for you feedback

 

Julien ROCHER

Développeur Team Data - Migration

 

Emeria Technologies

76-78 Avenue des Champs Elysées – 75008 Paris 

06 17 17 60 64

julien.rocher@emeria.eu

 

 

 

 

 

 

 

 

De : Julien Rouhaud <rjuju123@gmail.com>
Date : mercredi, 11 janvier 2023 à 14:27
À : ROCHER Julien <julien.rocher@emeria.eu>
Objet : Re: TR: Issue: --exclude-schema flag not working with pgrestore

On Wed, Jan 11, 2023 at 10:43:10AM +0000, ROCHER Julien wrote:
>
> Indeed this partially solved the problem. However, although it doesn’t try to
> restore the “country.number" table, it still tries to create the “country”
> schema. Do you think it’s wanted ?

Yes that's the wanted behavior.  Per documentation:

 -N schema / --exclude-schema=schema
    Do not restore objects that are in the named schema

So it filters objects **in** the schema but not the schema itself.

If you want to also ignore the CREATE SCHEMA order, or some fancier behavior,
you need to use the --list / --use-list and cherry pick the parts you want to
keep or discard.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Behavior of pg_catalog dependent on search_path: expected or bug?
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #17771: add a "status" column to the pg_rules system view