mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Revert CREATE INDEX ... INCLUDING ...
It's not ready yet, revert two commits690c543550
- unstable test output386e3d7609
- patch itself
This commit is contained in:
@ -646,7 +646,7 @@ check_exclusion_or_unique_constraint(Relation heap, Relation index,
|
||||
Oid *constr_procs;
|
||||
uint16 *constr_strats;
|
||||
Oid *index_collations = index->rd_indcollation;
|
||||
int indnkeyatts = IndexRelationGetNumberOfKeyAttributes(index);
|
||||
int index_natts = index->rd_index->indnatts;
|
||||
IndexScanDesc index_scan;
|
||||
HeapTuple tup;
|
||||
ScanKeyData scankeys[INDEX_MAX_KEYS];
|
||||
@ -673,7 +673,7 @@ check_exclusion_or_unique_constraint(Relation heap, Relation index,
|
||||
* If any of the input values are NULL, the constraint check is assumed to
|
||||
* pass (i.e., we assume the operators are strict).
|
||||
*/
|
||||
for (i = 0; i < indnkeyatts; i++)
|
||||
for (i = 0; i < index_natts; i++)
|
||||
{
|
||||
if (isnull[i])
|
||||
return true;
|
||||
@ -685,7 +685,7 @@ check_exclusion_or_unique_constraint(Relation heap, Relation index,
|
||||
*/
|
||||
InitDirtySnapshot(DirtySnapshot);
|
||||
|
||||
for (i = 0; i < indnkeyatts; i++)
|
||||
for (i = 0; i < index_natts; i++)
|
||||
{
|
||||
ScanKeyEntryInitialize(&scankeys[i],
|
||||
0,
|
||||
@ -717,8 +717,8 @@ check_exclusion_or_unique_constraint(Relation heap, Relation index,
|
||||
retry:
|
||||
conflict = false;
|
||||
found_self = false;
|
||||
index_scan = index_beginscan(heap, index, &DirtySnapshot, indnkeyatts, 0);
|
||||
index_rescan(index_scan, scankeys, indnkeyatts, NULL, 0);
|
||||
index_scan = index_beginscan(heap, index, &DirtySnapshot, index_natts, 0);
|
||||
index_rescan(index_scan, scankeys, index_natts, NULL, 0);
|
||||
|
||||
while ((tup = index_getnext(index_scan,
|
||||
ForwardScanDirection)) != NULL)
|
||||
@ -879,10 +879,10 @@ index_recheck_constraint(Relation index, Oid *constr_procs,
|
||||
Datum *existing_values, bool *existing_isnull,
|
||||
Datum *new_values)
|
||||
{
|
||||
int indnkeyatts = IndexRelationGetNumberOfKeyAttributes(index);
|
||||
int index_natts = index->rd_index->indnatts;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < indnkeyatts; i++)
|
||||
for (i = 0; i < index_natts; i++)
|
||||
{
|
||||
/* Assume the exclusion operators are strict */
|
||||
if (existing_isnull[i])
|
||||
|
Reference in New Issue
Block a user