RE: How to restore roles into new Database server?

From: Sridhar Parepalli <Sridhar(dot)Parepalli(at)sas(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RE: How to restore roles into new Database server?
Date: 2021-09-15 17:18:59
Message-ID: DM6PR05MB6265056BD2E5053702408CDEF3DB9@DM6PR05MB6265.namprd05.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you, Adrian!

-----Original Message-----
From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Sent: Wednesday, September 15, 2021 10:13 AM
To: Sridhar Parepalli <Sridhar(dot)Parepalli(at)sas(dot)com>; pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to restore roles into new Database server?

EXTERNAL

On 9/15/21 6:53 AM, Sridhar Parepalli wrote:
> Hello Pros,
> Is there a quick way to create roles from database server to another db server?

pg_dumpall -g the_database -f globals.sql

psql -d other_database -f globals.sql

Though this will include other global objects e.g. tablespaces.

See:

https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.postgresql.org%2Fdocs%2Fcurrent%2Fapp-pg-dumpall.html&amp;data=04%7C01%7CSridhar.Parepalli%40sas.com%7C33d6e5184b134c1fa0ee08d97852e376%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637673120233711031%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&amp;sdata=AYl6WE8Dc%2B0ZiBtFnVuaPrF%2BdMQRUHthdMsoQgJ5KgI%3D&amp;reserved=0

> Regards,
> Sridhar Parepalli
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sridhar Parepalli 2021-09-15 17:19:16 RE: How to restore roles into new Database server?
Previous Message Sridhar Parepalli 2021-09-15 17:18:43 RE: How to restore roles into new Database server?