Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgres list all roles

# psql command 
du
Comment

postgres list users and roles

SELECT r.rolname, r.rolsuper, r.rolinherit,
  r.rolcreaterole, r.rolcreatedb, r.rolcanlogin,
  r.rolconnlimit, r.rolvaliduntil,
  ARRAY(SELECT b.rolname
        FROM pg_catalog.pg_auth_members m
        JOIN pg_catalog.pg_roles b ON (m.roleid = b.oid)
        WHERE m.member = r.oid) as memberof
, r.rolreplication
, r.rolbypassrls
FROM pg_catalog.pg_roles r
WHERE r.rolname !~ '^pg_'
ORDER BY 1;
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql data types 
Sql :: where to locate set password for mysql 
Sql :: create a unqie constraint mysql 
Sql :: sql select divide column by number 
Sql :: if not exists insert sql 
Sql :: fetch first 5 characters of the string in sql 
Sql :: alter table name 
Sql :: sql server date format dd/mm/yyyy 
Sql :: XOR in SQL Server 
Sql :: sql update all rows 
Sql :: mysql error incompatible with sql_mode=only_full_group_by 
Sql :: add foreign key constraint in postgresql 
Sql :: how to create table in sql 
Sql :: select amount weeks between two dates mysql 
Sql :: sql remove not null constraint 
Sql :: sql add column int nullable 
Sql :: sql in sublime 
Sql :: insert query in ci 
Sql :: opensuse restart MySQL 
Sql :: postgresql how to show table names 
Sql :: mysql order 
Sql :: select top 10 rows in sql 
Sql :: sql backup database statement 
Sql :: select rows with same value in a column 
Sql :: how to get nearest location in mysql with latitude and longitude 
Sql :: mamp mysql path mac 
Sql :: ignore case like sql 
Sql :: mysql separator 
Sql :: concat using laravel 
Sql :: oracle create table if not exists 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =