Answers for "postgres show users"

SQL
14

postgresql list users

postgres=# \du
Posted by: Guest on May-28-2020
2

postgres list users

SELECT usename AS role_name,
       CASE
           WHEN usesuper AND usecreatedb THEN
               cast('superuser, create database' AS pg_catalog.text)
           WHEN usesuper THEN
               cast('superuser' AS pg_catalog.text)
           WHEN usecreatedb THEN
               cast('create database' AS pg_catalog.text)
           ELSE
               cast('' AS pg_catalog.text)
       END     AS role_attributes
FROM pg_catalog.pg_user
ORDER BY role_name DESC;
Posted by: Guest on November-05-2021
0

how to know the username of postgresql

SELECT current_user,
       user,
       session_user,
       current_database(),
       current_catalog,
       version();
Posted by: Guest on October-25-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language