I'm currently working on some project migrations and I want to create a single user in our New PostgreSQL with the same set of roles and permissions as the one in existing PostgreSQL.
I have searched regarding this but haven't found any answers.
how to create duplicate role of a user in postgres -> This solution is for same PostgreSQL instance
https://www.postgresonline.com/journal/archives/81-Backing-up-Login-Roles-aka-Users-and-Group-Roles.html -> Copies all the users with the same username and password. I don't want that.
Note: I don't want to copy the user ( username and password can be different, however, can be the same if the solution is easier), all I want is to create a new user in a new instance based on roles and permission in the existing PostgreSQL.