Re: [SQL] Constraint on multicolumn index

2006-11-14 Thread Stuart Brooks
> > But if I want the next item following t=(a=10,b=100,c=1000): > > > select * from T > > where (a=10 AND b=100 AND c>1000) OR (a=10 AND b>100) OR (a>10) > > order by a,b,c; > > The correct way to handle this is to use a SQL-spec row comparison: > > where (a,b,c) > (10,100,1000) > > Unfortunate

Re: [SQL] Constraint on multicolumn index

2006-11-10 Thread Tom Lane
"Stuart Brooks" <[EMAIL PROTECTED]> writes: > But if I want the next item following t=(a=10,b=100,c=1000): > select * from T > where (a=10 AND b=100 AND c>1000) OR (a=10 AND b>100) OR (a>10) > order by a,b,c; The correct way to handle this is to use a SQL-spec row comparison: where (a

[SQL] Constraint on multicolumn index

2006-11-10 Thread Stuart Brooks
Hi, I am not sure this can be done but I'm trying to constrain a sorted set efficiently using a multicolumn index in postgres. The (simplified) scenario is this: CREATE TABLE T ( a INT, b INT, c INT ); CREATE INDEX t_idx ON T(a,b,c); Now I can sort using t_idx: select * from T order by