Re: [GENERAL] Unique indicies

2008-02-22 Thread Dot Yet
oops yeah... must have read it clearly rgds, dotyet On 2/22/08, Erik Jones <[EMAIL PROTECTED]> wrote: > > > On Feb 22, 2008, at 8:38 AM, Dot Yet wrote: > > > that would mean > > > > Every row in foo for column f1 has to be unique > > and > > Every row in foo for column f2 has to be unique >

Re: [GENERAL] Unique indicies

2008-02-22 Thread Erik Jones
On Feb 22, 2008, at 8:38 AM, Dot Yet wrote: that would mean Every row in foo for column f1 has to be unique and Every row in foo for column f2 has to be unique The OP was asking about maintaining normal indexes on each in addition to the unique index on (f1, f2), not separate unique indexe

Re: [GENERAL] Unique indicies

2008-02-22 Thread Tom Lane
Naz Gassiep <[EMAIL PROTECTED]> writes: > If you have an index like this: > CREATE UNIQUE INDEX foo ON tablename (f1, f2); > Is there any value in having independent indicies on f1 and f2 as well > or are they unnecessary? See http://www.postgresql.org/docs/8.3/static/indexes.html particularly s

Re: [GENERAL] Unique indicies

2008-02-22 Thread Dot Yet
that would mean Every row in foo for column f1 has to be unique and Every row in foo for column f2 has to be unique Say for example: create table test1 ( a int, b int ) ; create unique index idx_t1_a on test1(a) ; create unique index idx_t1_b on test1(b) ; insert into test1 values (1,1) ; -- O

[GENERAL] Unique indicies

2008-02-22 Thread Naz Gassiep
If you have an index like this: CREATE UNIQUE INDEX foo ON tablename (f1, f2); Is there any value in having independent indicies on f1 and f2 as well or are they unnecessary? Thanks - Naz. ---(end of broadcast)--- TIP 5: don't forget to increas