Re: [HACKERS] Creating partial index on a relation

2013-10-31 Thread Kevin Grittner
naman.iitb naman.b...@gmail.com wrote:

 An example of partial index that i need is if my My table1 schema
 is (a int ,b int ,c int)

 index on c where a is null, b is null and c is not null

Your question is not very clear, but perhaps you are looking for
something like this:

CREATE INDEX index1 ON table1 (c)
  WHERE a IS NULL AND b IS NULL AND c IS NOT NULL;

This list is for discussion of adding features and fixing bugs in
the the PostgreSQL product.  For future posts requesting help with
*using* PostgreSQL please use the pgsql-general list.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Creating partial index on a relation

2013-10-31 Thread Craig Ringer
On 10/29/2013 04:15 PM, naman.iitb wrote:
 So is there a way to populate manually IndexStmt--whereClause 

Unless you have an _extremely_ compelling reason, you should probably
just use the SPI routines to execute a CREATE INDEX command.

-- 
 Craig Ringer   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training  Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers