title: Retrieve columns from pg_stat_all_indexes
body: <p>Given the following query:</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT pg_get_indexdef(indexrelid)
  FROM pg_stat_all_indexes
  WHERE schemaname = 'public'
  </code></pre>
  <p>I get all of the indexes that exist in the public schema. The question is if there's a way for me to query the columns that are indexed. For example, given the following table:</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE caregiver
  (
      id         INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
      ssn        TEXT,
  
      UNIQUE (ssn)
  );
  </code></pre>
  <p>I get the following index (<code>pg_get_indexdef(indexrelid)</code>):</p>
  <pre><code>CREATE UNIQUE INDEX caregiver_ssn_key ON public.caregiver USING btree (ssn)
  </code></pre>
  <p>Which I would like to return in the query the <code>ssn</code>.</p>
  <p>If there's an index that is a constraint of two or more columns, then I would like to get all of them. For example:</p>
  <pre><code>CREATE UNIQUE INDEX index_name ON public.caregiver_agency_assoc USING btree (agency_id, caregiver_id)
  </code></pre>
  <p>I would like to receive <code>agency_id</code> and <code>caregiver_id</code>.</p>