Re: how to use pg_dump to dump tables whose owner is me - Mailing list pgsql-general

From A. Rich
Subject Re: how to use pg_dump to dump tables whose owner is me
Date
Msg-id 518540.40996.qm@web81405.mail.mud.yahoo.com
Whole thread Raw
In response to Re: how to use pg_dump to dump tables whose owner is me  (Roger Chen <roger.edchen@gmail.com>)
List 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 by date:

Previous
From: John DeSoi
Date:
Subject: Re: grant everything on everything and then revoke
Next
From: Adrian Klaver
Date:
Subject: Re: postgreSQL & amazon ec2 cloud