Skip to content

Instantly share code, notes, and snippets.

@ketanbhatt
Created August 16, 2019 09:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ketanbhatt/fdbd6246b4b1b7bb32009de5e468ed57 to your computer and use it in GitHub Desktop.
Get a list of the indexes and their definitions for a given table, in Postgres
SELECT tablename,
indexname,
indexdef
FROM pg_indexes
WHERE tablename = '$$table_name$$'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment