Skip to content

Instantly share code, notes, and snippets.

@lym
Created January 15, 2015 16:05
Show Gist options
  • Save lym/d9b83272bf2f7d0d8371 to your computer and use it in GitHub Desktop.
Save lym/d9b83272bf2f7d0d8371 to your computer and use it in GitHub Desktop.
postgresql: retrieve owner of specified database
SELECT d.datname as "Name",
pg_catalog.pg_get_userbyid(d.datdba) as "Owner"
FROM pg_catalog.pg_database d
WHERE d.datname = 'database_name'
ORDER BY 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment