I need to be able to query the PostgreSQL database to get information about the available indexes and their details.
In SQL Server, I can do the following to get a list of all tables / indexes / columns for all indexes:
select TABLE_NAME, INDEX_NAME, NON_UNIQUE, COLUMN_NAME
from INFORMATION_SCHEMA.STATISTICS
where TABLE_SCHEMA = 'my_schema'
order by TABLE_NAME, INDEX_NAME, SEQ_IN_INDEX
The STATISTICS INFORMATION_SCHEMA table seems to be an extension of SQL Server. How can I make an equivalent in PostgreSQL?
EDIT: I specifically try to return a denormalized result set as follows
TableName, IndexName, UniqueFl, ColumnName
So, I get a row for each column in all indexes.
Thanks, John
source
share