Index definitions can be recreated with pg_get_indexdef()
from the System Catalog Information Functions, fed by the pg_index
system view. The output is theorically non-trivial to parse but in practice, a simple regexp is good enough to filter these definitions on certain index types.
For example, to find gist
or gin
indexes, you may use a query like this:
SELECT pg_get_indexdef(indexrelid) from pg_index
WHERE pg_get_indexdef(indexrelid) ~ 'USING (gin |gist )';
To find if a certain database uses fulltext, I'd probably search for tsvector
columns instead, with a query like this:
SELECT table_schema,table_name, column_name
FROM information_schema.columns
WHERE data_type='tsvector';