Skip to content

Instantly share code, notes, and snippets.

@jerinisready
Forked from garethrees/indexes.sql
Last active April 4, 2018 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jerinisready/cfe00ad293ec3ac1736250750aaf4bba to your computer and use it in GitHub Desktop.
Save jerinisready/cfe00ad293ec3ac1736250750aaf4bba to your computer and use it in GitHub Desktop.
List all indexes in postgres database
# VIEW INDEXES applied on database.
select schemaname, tablename, indexname, indexdef from pg_indexes WHERE schemaname='public';
# Create superuser for postgres on linux shell with postgres user.
user@ubuntu$ sudo su postgres
user@ubuntu$ createuser --interactive --pwprompt root
> Enter password for new role: ********
> Enter it again: ********
> Shall the new role be a superuser? (y/n) y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment