Hello,

I created some indexes with WHERE clauses, so that only part of the
table would be indexed. Now I'd like to get a list of indexes, and
include the WHERE clause if an index has one. This is what I'm trying
right now:

    SELECT indc.relname, ind.indpred
    FROM pg_index ind, pg_class indc
    WHERE indc.oid = ind.indexrelid;

But that gives results like this:

     relname            |               indpred
    --------------------+------------------------
    . . .
     index_pwords_on_language_id                              | NULL
     index_user_languages_on_user_id_and_language_id          |
{NULLTEST :arg {VAR :varno 1 :varattno 6 :vartype 1114 :vartypmod -1
:varcollid 0 :varlevelsup 0 :varnoold 1 :varoattno 6 :location 128}
:nulltesttype 0 :argisrow false}
     index_user_lists_on_user_id                              | NULL
     index_users_on_email                                     | NULL
    . . .

I'm not sure how to interpret that `indpred` column. Is there any way
to reconstruct the WHERE clause I originally passed to the CREATE
INDEX command?

Thanks,
Paul

-- 
_________________________________
Pulchritudo splendor veritatis.


-- 
Sent via pgsql-general mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to