Let’s assume caldav is the ‘old’ account.
{39} admin@linuxbuilder [~/pg] % ./bin/createuser newman
{40} admin@linuxbuilder [~/pg] % ./bin/psql template1 -c '\du'
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
admin | Superuser, Create role, Create DB, Replication | {}
caldav | Superuser, Create role, Create DB | {}
newman | | {}
# Give newman the same access as caldav, validate it.
{41} admin@linuxbuilder [~/pg] % ./bin/psql template1 -c 'grant caldav to newman'
GRANT ROLE
{42} admin@linuxbuilder [~/pg] % ./bin/psql template1 -c '\du'
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------+-----------
admin | Superuser, Create role, Create DB, Replication | {}
caldav | Superuser, Create role, Create DB | {}
newman | | {caldav}
Note that newman is now shown as a member of caldav. This means newman is allowed to do all the things that the caldav role can do. You don’t need to delete the caldav role.
Also, be advised that postgres roles and permissions are not at all related to filesystem permissions or system user accounts; except that if you don’t supply a postgres username when connecting, it will pick your current system user account name as the default.
HTH,
-dre