Creating partial index on a relation - Mailing list pgsql-hackers

From naman.iitb
Subject Creating partial index on a relation
Date
Msg-id 1383034521384-5776230.post@n5.nabble.com
Whole thread Raw
Responses Re: Creating partial index on a relation  (Kevin Grittner <kgrittn@ymail.com>)
Re: Creating partial index on a relation  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
Hello

I am doing a small project in Postgress where i have to achieve the
following:

Suppose i know the index name(lets say index1) and the relation(table1) on
which partial index to has to be build. 

I was looking through the code and found that IndexStmt-->whereClause is the
one that i need to populate manually . 

As of know i am successful in creating index by giving a call to Method
DefineIndex of indexcmds.c that creates a index on the relation, but this
index is not an partial index.

I found that DefineIndex takes *Expr *predicate* as an parameter which
specifies that partial index has to be built. This predicate is nothing but 
*IndexStmt-->whereClause *

So is there a way to populate manually IndexStmt-->whereClause 

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

Thanks in advance



Regards



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Creating-partial-index-on-a-relation-tp5776230.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: How should row-security affects ON UPDATE RESTRICT / CASCADE ?
Next
From: Tom Lane
Date:
Subject: Re: Fast insertion indexes: why no developments