Backing up users?

From: Mauri Sahlberg <Mauri(dot)Sahlberg(at)claymountain(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Backing up users?
Date: 2005-04-30 08:16:59
Message-ID: 42733EFB.2010908@claymountain.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

This might be a stupid question as it is not covered in the 7.4.7 and
probably obvious to all others. Where do the system catalogs live? How
to back them up? Should I back them up?

The admin manual states that to restore a pg_dumped database you should
have those users created that will have permission related to objects
created by pg_restore but gives no clear instructions how to back the
users up and how to restore them before restoring the database.

According to the manual, pg_dumps are relative to template0 so all
modifications relative to it will be backed up as well. This gives me a
reason to believe that users could live in template0 but do they?

What if I just wish to move a single database with it's users to a new
machine? It would be a disaster to overwrite whole existing system
catalog on the target machine.

Is it sufficient to select rows from pg_shadow and pg_group that are
related to the database in question and insert them in the new
environment? (The rows to use could probably be deducted from other
catalog tables and views by queries...)

Regards,
Mauri Sahlberg

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Bruno Wolff III 2005-04-30 12:18:12 Re: Backing up users?
Previous Message Tom Lane 2005-04-29 17:04:19 Re: Postges 8.0.2 Online backup Errors!