I need a new user but it should be granted all those privileges that the other existing user/role has.
e.g.
If a new User B is created, I need the same privileges as,
Dont ask why :/
Actually User A has custom privileges on different tables, schemas, and functions; so its very tedious and lengthy process to manually grant permissions to the new user. Any help would be good.
Try something like:
GRANT A TO B;
It will grant all right of role A to B.
For details read this
chapter of the manual.