1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-24 09:27:52 +03:00

Revert CREATE INDEX ... INCLUDING ...

It's not ready yet, revert two commits
690c543550 - unstable test output
386e3d7609 - patch itself
This commit is contained in:
Teodor Sigaev
2016-04-08 21:52:13 +03:00
parent 35e2e357cb
commit 8b99edefca
68 changed files with 256 additions and 1321 deletions

View File

@@ -19,7 +19,6 @@
#include "access/heapam.h"
#include "access/itup.h"
#include "access/tuptoaster.h"
#include "utils/rel.h"
/* ----------------------------------------------------------------
@@ -442,33 +441,3 @@ CopyIndexTuple(IndexTuple source)
memcpy(result, source, size);
return result;
}
/*
* Reform index tuple. Truncate nonkey (INCLUDING) attributes.
*/
IndexTuple
index_truncate_tuple(Relation idxrel, IndexTuple olditup)
{
TupleDesc itupdesc = RelationGetDescr(idxrel);
Datum values[INDEX_MAX_KEYS];
bool isnull[INDEX_MAX_KEYS];
IndexTuple newitup;
int indnatts = IndexRelationGetNumberOfAttributes(idxrel);
int indnkeyatts = IndexRelationGetNumberOfKeyAttributes(idxrel);
Assert(indnatts <= INDEX_MAX_KEYS);
Assert(indnkeyatts > 0);
Assert(indnkeyatts < indnatts);
index_deform_tuple(olditup, itupdesc, values, isnull);
/* form new tuple that will contain only key attributes */
itupdesc->natts = indnkeyatts;
newitup = index_form_tuple(itupdesc, values, isnull);
newitup->t_tid = olditup->t_tid;
itupdesc->natts = indnatts;
Assert(IndexTupleSize(newitup) <= IndexTupleSize(olditup));
return newitup;
}