Re: pg_restore but for full user and roles, etc

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_restore but for full user and roles, etc
Date: 2024-07-26 17:06:11
Message-ID: CANzqJaA-kRh2MMw58RD2-akXtAj7Z6Drv37_tbSfB3TX0+aaEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, Jul 26, 2024 at 12:43 PM Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
wrote:

> I am doing a pg_restore of a database, which is nothing difficult, but I
> also am creating a new server first, and rather than painstakingly making
> sure I create all users and roles etc prior to pg_restore (so we can have
> the same perms), is there some obvious way of doing this I'm unawares of?
>

Running "pg_dumpall -g > source_roles.sql" and then scanning it for the
relevant entries doesn't seem too onerous. It's a lot easier than the
conceptually similar -- but much trickier -- process you need to go through
when migrating SQL Server databases.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Wells Oliver 2024-07-26 17:15:32 Re: pg_restore but for full user and roles, etc
Previous Message Keith Fiske 2024-07-26 17:03:53 Re: pg_restore but for full user and roles, etc