how can I detect GIN and GiST indexes in postgresql? I am looking for if an database of postgres use fulltext. I think that a table use GIN o GiST then is using fulltext.
I accept that GIN or GiST indexes does not necessarily mean that they are used for full text search, but how can I differentiate them of other indexes type? I want to list Gin an Gist indexes
Index definitions can be recreated with
pg_get_indexdef()from the System Catalog Information Functions, fed by thepg_indexsystem 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
gistorginindexes, you may use a query like this:To find if a certain database uses fulltext, I’d probably search for
tsvectorcolumns instead, with a query like this: