Published on

PostgreSQL Basics: Listing Available Indexes in Your Database

Authors

You can list down all the available query in a Postgres database by running the following SQL statement

SELECT
	indexname,
	tablename,
	indexdef
FROM
	pg_indexes
WHERE
	schemaname = 'public' -- assuming you're querying in "public" schema. If not, change the schema here
ORDER BY
	tablename,
	indexname;

You should be getting result like this 👇

Happy listing indexes!