Re: Index AM API changes for deferability - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Index AM API changes for deferability
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: Index AM API changes for deferability  (Tom Lane <[email protected]>)
Responses Re: Index AM API changes for deferability
List pgsql-hackers
2009/7/15 Tom Lane <[email protected]>:
> There is no reason at all to avoid an index AM API change if one is
> useful.

Thinking about this a bit more, perhaps it would be better if I added
an out parameter to the AM for the uniqueness result, rather than
overloading the return value, which is quite ugly:

bool
index_insert(Relation indexRelation,            Datum *values,            bool *isnull,            ItemPointer
heap_t_ctid,           Relation heapRelation,            IndexUniqueCheck uniqueness_check,            bool
*is_unique);

This would allow me to tidy up some of the code I added to
ExecInsertIndexTuples() which is a bit of a kludge to support
the hash indexes enforcing uniqueness in the future:

http://archives.postgresql.org/pgsql-hackers/2009-07/msg00812.php

Also I could then move the ereport() for unique key violations from
_bt_check_unique() into index_insert() which would allow the
Duplicate key value error patch to be non-btree-specific:

http://archives.postgresql.org/message-id/[email protected]
http://archives.postgresql.org/message-id/[email protected]

Thoughts?


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: mixed, named notation support
Next
From: Greg Stark
Date:
Subject: Re: MIN/MAX optimization for partitioned table