Postgres short snippets

This is a snippet that contains handy postgres snippets.

SELECT * FROM pg_user WHERE usesuper = true;
sql
Find all superusers
SELECT current_user;
sql
Find name of current user
SELECT pg_namespace.nspname, pg_class.relname, pg_trigger.*
FROM pg_trigger
JOIN pg_class ON pg_trigger.tgrelid = pg_class.oid
JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace
sql
List all triggers
Problem with this page? Submit a change here.