From: | Heikki Linnakangas <heikki(at)enterprisedb(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Sam Mason <sam(at)samason(dot)me(dot)uk>, pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #3723: dropping an index that doesn't refer to table's columns |
Date: | 2007-11-06 14:26:14 |
Message-ID: | 47307986.70409@enterprisedb.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Tom Lane wrote:
> "Sam Mason" <sam(at)samason(dot)me(dot)uk> writes:
>> p.s. the reason for creating this strange index was to ensure that a maximum
>> of one row was inserted into the table---I can do this different ways for
>> now.
>
> Please explain how you thought it would help you do that, because
> without some evidence that there's a use-case, I'm inclined to fix it
> as above ...
Note that it was a unique index:
postgres=# CREATE TABLE silly (id integer);
CREATE TABLE
postgres=# CREATE UNIQUE INDEX i_silly ON silly ((1));
CREATE INDEX
postgres=# INSERT INTO silly VALUES (1);
INSERT 0 1
postgres=# INSERT INTO silly VALUES (2);
ERROR: duplicate key value violates unique constraint "i_silly"
Not sure that's enough of a use case to justify not banning it...
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2007-11-06 15:00:43 | Re: BUG #3723: dropping an index that doesn't refer to table's columns |
Previous Message | Tom Lane | 2007-11-06 14:21:45 | Re: BUG #3723: dropping an index that doesn't refer to table's columns |