Postgresql allows adding comments to roles and users. For example I've added a comment to role "myuser" by using this SQL command:
COMMENT ON ROLE myuser IS 'User comment...';
My question is: If I want to use a SQL-command to get all users along with their respective comment - how would I do this? What would be the appropriate query for this?
Łukasz Kamiński :
You need to use built-in function shobj_description(object_oid, catalog_name)\n\nSELECT *, shobj_description(oid, 'pg_authid') AS comment\n FROM pg_roles;\n",
2018-03-02T13:00:03