Re: WIP: generalized index constraints - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: WIP: generalized index constraints
Date
Msg-id 37ed240d0907161651s7c70f64fn1f7eedd4f9441dd0@mail.gmail.com
Whole thread Raw
In response to Re: WIP: generalized index constraints  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: WIP: generalized index constraints  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
2009/7/17 Jeff Davis <pgsql@j-davis.com>:
> Another idea that I thought about is that:
>
>   ALTER TABLE foo ADD UNIQUE (a, b) USING foo_idx;
>
> could be a shorthand for:
>
>   ALTER TABLE foo ADD INDEX CONSTRAINT (a =, b =) USING foo_idx;
>
> The benefit is that it could go over GiST indexes or hash indexes, not
> just btrees. The syntax could also be useful to turn an existing btree
> into a unique btree.

I like that idea ... although how would this interact (if at all) with
the existing pg_index.isunique flag?  Would it become deprecated in
favour of using indconstrats, or would you actually look at switching
isunique to TRUE if somebody applies a constraint which is made up
entirely of equality ops?

Cheers,
BJ


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Docbook toolchain interfering with patch review?
Next
From: Brendan Jurd
Date:
Subject: Re: Docbook toolchain interfering with patch review?