Re: User/Roles, Owner, and privileges migration strategy

Поиск
Список
Период
Сортировка
От Ron
Тема Re: User/Roles, Owner, and privileges migration strategy
Дата
Msg-id 5e4394dd-99b4-41b8-af38-e41f52415140@gmail.com
обсуждение исходный текст
Ответ на Re: User/Roles, Owner, and privileges migration strategy  (ADITYA DUVURI <adilove1987@gmail.com>)
Ответы Re: User/Roles, Owner, and privileges migration strategy  (Aditya D <dsaditya91@gmail.com>)
Список pgsql-admin
On 10/21/23 21:51, ADITYA DUVURI wrote:
Hi Team,

Let me take a user scenario here, I have an On-premises PostgreSQL instance with 50 databases. Out of which I need to migrate only 15 databases. There are around 10 different users and roles and millions of different database objects.
In this example at the database level the owner for some objects are - 
image.png

When I perform pg_dump with owners and ACL. the statements formed are -
  • Create Table2
  • Alter Owner Table2 to user2
  • Grant All privileges on Table2 to user2
The issue while restoring the above dump file created in any on-premises/AWS/GCP PostgreSQL instance fails since the grant statements have to be executed first before the Alter owner statement.

Did you first run "pg_dumpall --globals-only" against the on-prem server?  (Maybe you did, and I missed it.)

That has all of the CREATE and ALTER ROLE statements.  You'll have to edit it first, though, to remove references to role "postgres", and other statements that are outdated, or irrelevant to AWS RDS.

--
Born in Arizona, moved to Babylonia.
Вложения

В списке pgsql-admin по дате отправления:

Предыдущее
От: Holger Jakobs
Дата:
Сообщение: Re: User/Roles, Owner, and privileges migration strategy
Следующее
От: M Sarwar
Дата:
Сообщение: Re: Need to run pg_dump from the laptop without entering the password