Re: [GENERAL] Partial Indices vs. mixing columns and functions

2001-07-16 Thread Tom Lane
Hiroshi Inoue <[EMAIL PROTECTED]> writes: > What kind of expression is allowed as the predicate now ? Anything that doesn't involve an aggregate or a subselect. (But what the planner can recognize as matching a query's WHERE clause is currently much more restricted, just ANDs and ORs of simple V

Re: [GENERAL] Partial Indices vs. mixing columns and functions

2001-07-11 Thread Mike Mascari
Tom Lane wrote: > > Mike Mascari <[EMAIL PROTECTED]> writes: > > To enforce uniqueness because > > deactive is NULL, I cannot just create an index like: > > > CREATE UNIQUE INDEX i_foo (value, deactive); > > It's not clear to me what you are really after here. You *can* create a > unique index

Re: [GENERAL] Partial Indices vs. mixing columns and functions

2001-07-11 Thread Tom Lane
Mike Mascari <[EMAIL PROTECTED]> writes: > To enforce uniqueness because > deactive is NULL, I cannot just create an index like: > CREATE UNIQUE INDEX i_foo (value, deactive); It's not clear to me what you are really after here. You *can* create a unique index, even though 'deactive' is allowed

Re: [GENERAL] Partial Indices vs. mixing columns and functions

2001-07-11 Thread Mike Mascari
I just wrote: > What are the limits of the WHERE expression? Must they be composed of > constant expressions or can they be more complex? [snip] Sorry. I see the SGML in your patch: "Each element can only consist of ATTR OP CONST and these can only be joined by AND and OR operators." Mike Mas

Re: [GENERAL] Partial Indices vs. mixing columns and functions

2001-07-11 Thread Mike Mascari
Martijn van Oosterhout wrote: > > On Wed, Jul 11, 2001 at 04:09:51AM -0400, Mike Mascari wrote: > > Hello, > > > > I have created table/view pairs like: > > [snip] > > Yes, creating a unique partial index should be possible and will do what you > want I think, (I couldn't totally follow what yo

Re: [GENERAL] Partial Indices vs. mixing columns and functions

2001-07-11 Thread Martijn van Oosterhout
On Wed, Jul 11, 2001 at 04:09:51AM -0400, Mike Mascari wrote: > Hello, > > I have created table/view pairs like: [snip] Yes, creating a unique partial index should be possible and will do what you want I think, (I couldn't totally follow what you meant). However, partial indicies will not supp

[GENERAL] Partial Indices vs. mixing columns and functions

2001-07-11 Thread Mike Mascari
Hello, I have created table/view pairs like: CREATE TABLE foo ( key integer not null, value text not null, active timestamp not null default now(), deactive timestamp ); CREATE VIEW v_foo AS SELECT * FROM foo WHERE deactive IS NULL; This allows the user-interface component of the application t