Re: how to use pg_dump to dump tables whose owner is me

Поиск
Список
Период
Сортировка
От A. Rich
Тема Re: how to use pg_dump to dump tables whose owner is me
Дата
Msg-id 518540.40996.qm@web81405.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: how to use pg_dump to dump tables whose owner is me  (Roger Chen <roger.edchen@gmail.com>)
Список pgsql-general
--- On Tue, 3/3/09, Roger Chen <roger.edchen@gmail.com> wrote:

> >> Hi,
> >> Can anyone tell me how to do that? I could find
> that in man page of
> >> pg_dump. Thanks.
> >
> > pg_dump -t table1 -t table2
> >

> Thanks. If there are many tables owned by me and some other
> users, are
> there any easy ways to do that?
>

I would use psql to query all the tables you own to a file,
using a query like this:

select schemaname || '.' || tablename as to_dump
from pg_tables
where tableowner = 'myuser'

And then use xargs to or similar text tools to generate the pg_dump
command you need.




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

Предыдущее
От: John DeSoi
Дата:
Сообщение: Re: grant everything on everything and then revoke
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: postgreSQL & amazon ec2 cloud