Voici ses principaux champs :
Nom du champ | Type du champ | Description du champ |
oid | oid | Identifiant de l'index. |
indexrelid | oid | Identifiant de l'objet index. |
indisunique | boolean | TRUE si l'index est unique. |
indkey | int2[] | Numéro des colonnes indexées. |
indrelid | oid | Identifiant de la table. |
SELECT
d.usename,
'',
'',
b.relname,
e.relname,
CASE a.indisunique
WHEN TRUE THEN 1
ELSE 0
END,
c.attname,
c.attnum
FROM pg_index a, pg_class b, pg_attribute c, pg_user d, pg_class e
WHERE
b.oid=a.indrelid
AND c.attrelid=b.oid
AND c.attnum=ANY(a.indkey)
AND d.usesysid=b.relowner
AND a.indexrelid=e.oid
AND d.usename LIKE 'MonProprietaire%'
AND c.relname LIKE 'MaTable%'
ORDER BY b.relname, e.relname, c.attnum;