In SQL Server we have INDEXPROPERTY function. Example of usage: INDEXPROPERTY(ObjectId, IndexName, 'IndexDepth') Is there any PostgreSQL analogs? I didn't find any surfing the Internet.
UPDATE: So we are currently migrating from SQL Server to PostgreSQL and I have to convert a dozen procedures. One of them is responsible of index rebuilding. In the original procedure we check do we have indexes for rebuild. Here is a piece of code I'm talking about:
SELECT @numberoftables = COUNT(DISTINCT objectname)
FROM #fraglist
WHERE (LogicalFrag >= @maxfrag OR [ScanDensity] < @mindensity)
AND CountPages > 100
AND INDEXPROPERTY(ObjectId, IndexName, 'IndexDepth') > 0;
#fraglist contains all indexes and their parameters.