Thread: copying pg_user?

copying pg_user?

From
James Hall
Date:
Hello,

I have 2 PostgreSQL databases that [I thought] were identical. Today I
noticed that the query "select * from pg_user;" results in different results
from each database.

My question is what is the easiest/best/safest way to copy the pg_user file
from db to another? Can I simply copy the pg_user file from one db to the
other and restart the db, or should I use pg_dump on pg_user and import like
that?

Any and all suggestions are greatly appreciated!
TIA
-Jim

Re: copying pg_user?

From
Tom Lane
Date:
James Hall <James.Hall@RadioShack.com> writes:
> My question is what is the easiest/best/safest way to copy the pg_user file
> from db to another?

pg_user is a view.  You can copy pg_shadow if you are so inclined.
See the pg_dumpall script, which does exactly that before dumping
the database(s) proper.

            regards, tom lane