title: PostgreSQL duplicate a user with same permission
body: <p>I'm currently working on some project migrations and I want to <strong>create a single user in our New PostgreSQL</strong> with the same set of roles and permissions as the one in <strong>existing PostgreSQL</strong>.</p>
  <p>I have searched regarding this but haven't found any answers.</p>
  <p><a href="https://stackoverflow.com/questions/16591557/how-to-create-duplicate-role-of-a-user-in-postgres">how to create duplicate role of a user in postgres</a> -&gt; This solution is for same PostgreSQL instance</p>
  <p><a href="https://www.postgresonline.com/journal/archives/81-Backing-up-Login-Roles-aka-Users-and-Group-Roles.html" rel="nofollow noreferrer">https://www.postgresonline.com/journal/archives/81-Backing-up-Login-Roles-aka-Users-and-Group-Roles.html</a> -&gt; Copies all the users with the same username and password. I don't want that.</p>
  <p><strong>Note</strong>: 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.</p>