Re: [GENERAL] See the WHERE clause of a partial index

2012-09-14 Thread Paul Jungwirth
> I think the OID > argument will need to be the table not the index, but not 100% sure. Yep, that's true. :-) Paul -- _ Pulchritudo splendor veritatis. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription

Re: [GENERAL] See the WHERE clause of a partial index

2012-09-14 Thread Paul Jungwirth
> pg_get_indexdef() should help. If you really want just the WHERE > clause, possibly pg_get_expr() would work, but I've not tried it on > index clauses. Thank you for such a quick response! pg_get_indexdef is very helpful: > select pg_get_indexdef(223630); pg_get_indexdef ---

Re: [GENERAL] See the WHERE clause of a partial index

2012-09-14 Thread Tom Lane
Paul Jungwirth writes: > It'd be great to get just the WHERE clause if possible, although I can > work around it if not. I couldn't find much documentation re > pg_get_expr. Does this message mean I can't use it, or am I just doing > something wrong?: >> select pg_get_expr('{NULLTEST :arg {VA

Re: [GENERAL] See the WHERE clause of a partial index

2012-09-14 Thread Paul Jungwirth
> It'd be great to get just the WHERE clause if possible, although I can > work around it if not. I couldn't find much documentation re > pg_get_expr. To answer my own question, this works: > select pg_get_expr(indpred, indrelid) from pg_index where indexrelid = 223630; pg_get_expr

Re: [GENERAL] See the WHERE clause of a partial index

2012-09-14 Thread Tom Lane
Paul Jungwirth writes: > 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? pg_get_indexdef() should help. If you really want just the WHERE clause, possibly pg_get_expr() would work, but I've

[GENERAL] See the WHERE clause of a partial index

2012-09-14 Thread Paul Jungwirth
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