Thread: pg_dump on one user not whole database

pg_dump on one user not whole database

From
Ruth Hsieh
Date:
The postgreSQL release used is 7.3.4.  We would like to dump the objects for
particular user.  How?  I used -U option, the result still dump all the objects
with all the users.

In order to migrate to 7.4, if the users were not created in 7.4 the pg_dump
result will fail or create under wrong user.  How to prevent this?

What is different between pg_restore and psql if restore the pg_dump result?  I
tried to use pg_restore, but it always fail.  However, using psql it work.  In
turn of the performance, which one is the faster?

Thanks
--
Ruth Hsieh
Mobility IN, Lucent Technologies

Re: pg_dump on one user not whole database

From
"Keith C. Perry"
Date:
Quoting Ruth Hsieh <rhsieh@lucent.com>:

> The postgreSQL release used is 7.3.4.  We would like to dump the objects for
> particular user.  How?  I used -U option, the result still dump all the
> objects
> with all the users.

The -U is just the user you connect as.  I think you what you might be wanting
to do dump a particular table or database.  Some more information about how your
system is set up would be useful here but I think a not so elegant solution
would be so dump each database own by the user your want manual.  There may be a
way to dump all the database's owned by a certain user but I don't know.

> In order to migrate to 7.4, if the users were not created in 7.4 the pg_dump
> result will fail or create under wrong user.  How to prevent this?

I had a problem with this when I was test 7.4beta5.  The easiest thing to do I
round was to use the pg_dumpall program from 7.4.  You can dump over a tcp/ip
connection.  I had no problems loading data from 7.1.3 or 7.3.4 using that method.

> What is different between pg_restore and psql if restore the pg_dump result?
> I
> tried to use pg_restore, but it always fail.  However, using psql it work.
> In
> turn of the performance, which one is the faster?

I don't use pg_restore because I prefer to dump as text.  Pg_restore gives you
better flexibility in your restores but it is not text based.  I don't know but
I supect that pg_restore is probably faster on "large" data sets.

> Thanks
> --
> Ruth Hsieh
> Mobility IN, Lucent Technologies


--
Keith C. Perry, MS E.E.
Director of Networks & Applications
VCSN, Inc.
http://vcsn.com

____________________________________
This email account is being host by:
VCSN, Inc : http://vcsn.com