Re: pg_restore -L reordering of the statements does not work - Mailing list pgsql-admin

From David G. Johnston
Subject Re: pg_restore -L reordering of the statements does not work
Date
Msg-id CAKFQuwbhB3KXR3QWWcxAjX=iWdL5mjXVTWy6B9dLTutiftbLOw@mail.gmail.com
Whole thread Raw
In response to Re: pg_restore -L reordering of the statements does not work  (Aditya D <dsaditya91@gmail.com>)
Responses Re: pg_restore -L reordering of the statements does not work
List pgsql-admin
On Sat, Oct 28, 2023, 18:37 Aditya D <dsaditya91@gmail.com> wrote:
Thanks a lot Tom for the detailed info. Few queries -

1. Is there any way I can create my own list file?
2. For Alter table <<table name>> owner to <<role name>> statement, what is the equivalent line in the list file?
3. Was using List file to achieve the following, i.e. executing the following lines in this order -
* Restoring the dump file using list file with role <<user1>>
* create table schema1.table1
* grant all on schema1 to user2
* alter table schema1.table1 to user2

Is the above possible using list file, if not what is the best alternative as we would like to automate.

PS: Don't have super user privileges on the target.

Why can you not create a role on the target that is a member of every other role and thus can create and reassign delegated permissions and ownership to any of them.  In short, a role that behaves as superuser within this limited context even if they are not a true superuser.

David J.

pgsql-admin by date:

Previous
From: Aditya D
Date:
Subject: Re: pg_restore -L reordering of the statements does not work
Next
From: Tom Lane
Date:
Subject: Re: pg_restore -L reordering of the statements does not work