Re: $user namespace with pg_dump?

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: $user namespace with pg_dump?
Дата
Msg-id 56D733E8.6010809@aklaver.com
обсуждение исходный текст
Ответ на $user namespace with pg_dump?  ("Mark E. Haase" <mehaase@gmail.com>)
Список pgsql-general
On 03/02/2016 09:06 AM, Mark E. Haase wrote:
> I can `SET search_path TO "$user",foo,bar,public` and the first path
> element will expand to the current user.
>
> Can I do the same for `pg_dump -n`? I've tried many variations but none
> of them appear to work:
>
>      pg_dump -U myuser -n '($user|foo|bar|public)' ...
>      pg_dump -U myuser -n '("$user"|foo|bar|public)' ...
>      pg_dump -U myuser -n '(\$user|foo|bar|public)' ...
>
> I can't tell if I'm doing something wrong or if $user expansion is just
> some magic in SET that doesn't exist in pg_dump or `\dn`.
>
> (The workaround is obvious, of course: replace $user with the value of
> the -U argument . This is a question of curiosity, not practicality.)
>
> Also, is there any difference between `pg_dump -n '(foo|bar)'` and
> `pg_dump -n foo -n bar`? In my narrow testing, they produce identical
> results.

Not as far I can see:

http://www.postgresql.org/docs/9.5/interactive/app-pgdump.html#PG-DUMP-EXAMPLES

To dump all schemas whose names start with east or west and end in gsm,
excluding any schemas whose names contain the word test:

$ pg_dump -n 'east*gsm' -n 'west*gsm' -N '*test*' mydb > db.sql

The same, using regular expression notation to consolidate the switches:

$ pg_dump -n '(east|west)*gsm' -N '*test*' mydb > db.sql

>
> Thanks,
>
> --
> Mark E. Haase


--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: How to ensure that a stored function always returns TRUE or FALSE?
Следующее
От: Alan Droege
Дата:
Сообщение: ...