On 8/18/2004 12:18 PM, Tom Lane wrote:

Richard Huxton <[EMAIL PROTECTED]> writes:
* Allow multiple unique constraints to share an index where one is a superset of the others' columns.

That way you can mark it unique without having the overhead of multiple indexes.

That just moves the uncertain-dependency problem over one spot, ie, it's the fabricated unique constraint that you can't pin down the requirements for.

If we allow for a unique index, that

    * it is NOT maintained (no index tuples in there)
    * depends on another index that has a subset of columns
    * if that subset-index is dropped, the index becomes maintained

then the uncertainty is gone. At the time someone drops the other constraint or unique index, the data is unique with respect to the superset of columns. So building the unique index data at that time will succeed.


Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== [EMAIL PROTECTED] #

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
     joining column's datatypes do not match

Reply via email to