I am trying to restore the backup of the database but it's giving me the error of roles, so I got to know that first, we have to take backup of roles/users then we take complete backup but I am unaware of command that can be used. can anyone help me with the command?
how to take backup of only roles/users in postgresql?
Asked Answered
You can use pg_dumpall
for that with the --globals-only
option:
pg_dumpall --globals-only --file=all_roles_and_users.sql -p postgres -h ...
The file all_roles_and_users.sql
will contain all roles and role memberships currently defined in the instance (aka "cluster") you connect to.
This nee
© 2022 - 2024 — McMap. All rights reserved.