diff options
| author | Teodor Sigaev | 2016-04-08 18:52:13 +0000 |
|---|---|---|
| committer | Teodor Sigaev | 2016-04-08 18:52:13 +0000 |
| commit | 8b99edefcab1e82c43139a2c7dc06d31fb27b3e4 (patch) | |
| tree | 5428925d16447c4d204e0956e6d2ae1032847585 /src/include | |
| parent | 35e2e357cb054dc9e5d890fe754c56f0722f015e (diff) | |
Revert CREATE INDEX ... INCLUDING ...
It's not ready yet, revert two commits
690c543550b0d2852060c18d270cdb534d339d9a - unstable test output
386e3d7609c49505e079c40c65919d99feb82505 - patch itself
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/amapi.h | 2 | ||||
| -rw-r--r-- | src/include/access/itup.h | 2 | ||||
| -rw-r--r-- | src/include/access/nbtree.h | 3 | ||||
| -rw-r--r-- | src/include/catalog/catversion.h | 2 | ||||
| -rw-r--r-- | src/include/catalog/pg_constraint.h | 23 | ||||
| -rw-r--r-- | src/include/catalog/pg_constraint_fn.h | 21 | ||||
| -rw-r--r-- | src/include/catalog/pg_index.h | 38 | ||||
| -rw-r--r-- | src/include/nodes/execnodes.h | 9 | ||||
| -rw-r--r-- | src/include/nodes/parsenodes.h | 5 | ||||
| -rw-r--r-- | src/include/nodes/relation.h | 13 | ||||
| -rw-r--r-- | src/include/utils/rel.h | 16 |
11 files changed, 48 insertions, 86 deletions
diff --git a/src/include/access/amapi.h b/src/include/access/amapi.h index 17e652c61b..35f1061b3a 100644 --- a/src/include/access/amapi.h +++ b/src/include/access/amapi.h @@ -142,8 +142,6 @@ typedef struct IndexAmRoutine bool amclusterable; /* does AM handle predicate locks? */ bool ampredlocks; - /* does AM support columns included with clause INCLUDING? */ - bool amcaninclude; /* type of data stored in index, or InvalidOid if variable */ Oid amkeytype; diff --git a/src/include/access/itup.h b/src/include/access/itup.h index b5424c396a..8350fa0084 100644 --- a/src/include/access/itup.h +++ b/src/include/access/itup.h @@ -18,7 +18,6 @@ #include "access/tupmacs.h" #include "storage/bufpage.h" #include "storage/itemptr.h" -#include "utils/rel.h" /* * Index tuple header structure @@ -148,6 +147,5 @@ extern Datum nocache_index_getattr(IndexTuple tup, int attnum, extern void index_deform_tuple(IndexTuple tup, TupleDesc tupleDescriptor, Datum *values, bool *isnull); extern IndexTuple CopyIndexTuple(IndexTuple source); -extern IndexTuple index_truncate_tuple(Relation idxrel, IndexTuple olditup); #endif /* ITUP_H */ diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h index 79039df40a..9046b166bd 100644 --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.h @@ -683,8 +683,7 @@ extern bool _bt_doinsert(Relation rel, IndexTuple itup, IndexUniqueCheck checkUnique, Relation heapRel); extern Buffer _bt_getstackbuf(Relation rel, BTStack stack, int access); extern void _bt_finish_split(Relation rel, Buffer bbuf, BTStack stack); -extern bool _bt_pgaddtup(Page page, Size itemsize, IndexTuple itup, - OffsetNumber itup_off); + /* * prototypes for functions in nbtpage.c */ diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index d8556cedf0..6d254ba133 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 201604081 +#define CATALOG_VERSION_NO 201604071 #endif diff --git a/src/include/catalog/pg_constraint.h b/src/include/catalog/pg_constraint.h index bff2fd175b..666b2304bf 100644 --- a/src/include/catalog/pg_constraint.h +++ b/src/include/catalog/pg_constraint.h @@ -99,12 +99,6 @@ CATALOG(pg_constraint,2606) int16 conkey[1]; /* - * Columns of conrelid that the constraint does not apply to, - * but included into the same index with key columns. - */ - int16 conincluding[1]; - - /* * If a foreign key, the referenced columns of confrelid */ int16 confkey[1]; @@ -156,7 +150,7 @@ typedef FormData_pg_constraint *Form_pg_constraint; * compiler constants for pg_constraint * ---------------- */ -#define Natts_pg_constraint 25 +#define Natts_pg_constraint 24 #define Anum_pg_constraint_conname 1 #define Anum_pg_constraint_connamespace 2 #define Anum_pg_constraint_contype 3 @@ -174,14 +168,13 @@ typedef FormData_pg_constraint *Form_pg_constraint; #define Anum_pg_constraint_coninhcount 15 #define Anum_pg_constraint_connoinherit 16 #define Anum_pg_constraint_conkey 17 -#define Anum_pg_constraint_conincluding 18 -#define Anum_pg_constraint_confkey 19 -#define Anum_pg_constraint_conpfeqop 20 -#define Anum_pg_constraint_conppeqop 21 -#define Anum_pg_constraint_conffeqop 22 -#define Anum_pg_constraint_conexclop 23 -#define Anum_pg_constraint_conbin 24 -#define Anum_pg_constraint_consrc 25 +#define Anum_pg_constraint_confkey 18 +#define Anum_pg_constraint_conpfeqop 19 +#define Anum_pg_constraint_conppeqop 20 +#define Anum_pg_constraint_conffeqop 21 +#define Anum_pg_constraint_conexclop 22 +#define Anum_pg_constraint_conbin 23 +#define Anum_pg_constraint_consrc 24 /* ---------------- * initial contents of pg_constraint diff --git a/src/include/catalog/pg_constraint_fn.h b/src/include/catalog/pg_constraint_fn.h index 72f4502f99..1f11174210 100644 --- a/src/include/catalog/pg_constraint_fn.h +++ b/src/include/catalog/pg_constraint_fn.h @@ -27,31 +27,30 @@ typedef enum ConstraintCategory CONSTRAINT_ASSERTION /* for future expansion */ } ConstraintCategory; -extern Oid CreateConstraintEntry(const char* constraintName, +extern Oid CreateConstraintEntry(const char *constraintName, Oid constraintNamespace, char constraintType, bool isDeferrable, bool isDeferred, bool isValidated, Oid relId, - const int16* constraintKey, + const int16 *constraintKey, int constraintNKeys, - int constraintNTotalKeys, Oid domainId, Oid indexRelId, Oid foreignRelId, - const int16* foreignKey, - const Oid* pfEqOp, - const Oid* ppEqOp, - const Oid* ffEqOp, + const int16 *foreignKey, + const Oid *pfEqOp, + const Oid *ppEqOp, + const Oid *ffEqOp, int foreignNKeys, char foreignUpdateType, char foreignDeleteType, char foreignMatchType, - const Oid* exclOp, - Node* conExpr, - const char* conBin, - const char* conSrc, + const Oid *exclOp, + Node *conExpr, + const char *conBin, + const char *conSrc, bool conIsLocal, int conInhCount, bool conNoInherit, diff --git a/src/include/catalog/pg_index.h b/src/include/catalog/pg_index.h index fcbd18ab58..ee97c5dec8 100644 --- a/src/include/catalog/pg_index.h +++ b/src/include/catalog/pg_index.h @@ -32,8 +32,7 @@ CATALOG(pg_index,2610) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO { Oid indexrelid; /* OID of the index */ Oid indrelid; /* OID of the relation it indexes */ - int16 indnatts; /* total number of columns in index */ - int16 indnkeyatts; /* number of key columns in index */ + int16 indnatts; /* number of columns in index */ bool indisunique; /* is this a unique index? */ bool indisprimary; /* is this index for primary key? */ bool indisexclusion; /* is this index for exclusion constraint? */ @@ -71,27 +70,26 @@ typedef FormData_pg_index *Form_pg_index; * compiler constants for pg_index * ---------------- */ -#define Natts_pg_index 20 +#define Natts_pg_index 19 #define Anum_pg_index_indexrelid 1 #define Anum_pg_index_indrelid 2 #define Anum_pg_index_indnatts 3 -#define Anum_pg_index_indnkeyatts 4 -#define Anum_pg_index_indisunique 5 -#define Anum_pg_index_indisprimary 6 -#define Anum_pg_index_indisexclusion 7 -#define Anum_pg_index_indimmediate 8 -#define Anum_pg_index_indisclustered 9 -#define Anum_pg_index_indisvalid 10 -#define Anum_pg_index_indcheckxmin 11 -#define Anum_pg_index_indisready 12 -#define Anum_pg_index_indislive 13 -#define Anum_pg_index_indisreplident 14 -#define Anum_pg_index_indkey 15 -#define Anum_pg_index_indcollation 16 -#define Anum_pg_index_indclass 17 -#define Anum_pg_index_indoption 18 -#define Anum_pg_index_indexprs 19 -#define Anum_pg_index_indpred 20 +#define Anum_pg_index_indisunique 4 +#define Anum_pg_index_indisprimary 5 +#define Anum_pg_index_indisexclusion 6 +#define Anum_pg_index_indimmediate 7 +#define Anum_pg_index_indisclustered 8 +#define Anum_pg_index_indisvalid 9 +#define Anum_pg_index_indcheckxmin 10 +#define Anum_pg_index_indisready 11 +#define Anum_pg_index_indislive 12 +#define Anum_pg_index_indisreplident 13 +#define Anum_pg_index_indkey 14 +#define Anum_pg_index_indcollation 15 +#define Anum_pg_index_indclass 16 +#define Anum_pg_index_indoption 17 +#define Anum_pg_index_indexprs 18 +#define Anum_pg_index_indpred 19 /* * Index AMs that support ordered scans must support these two indoption diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index e5df6da658..dbec07e5a3 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -33,11 +33,9 @@ * entries for a particular index. Used for both index_build and * retail creation of index entries. * - * NumIndexAttrs total number of columns in this index - * NumIndexKeyAttrs number of key columns in index + * NumIndexAttrs number of columns in this index * KeyAttrNumbers underlying-rel attribute numbers used as keys - * (zeroes indicate expressions). It also contains - * info about included columns. + * (zeroes indicate expressions) * Expressions expr trees for expression entries, or NIL if none * ExpressionsState exec state for expressions, or NIL if none * Predicate partial-index predicate, or NIL if none @@ -60,8 +58,7 @@ typedef struct IndexInfo { NodeTag type; - int ii_NumIndexAttrs; /* total number of columns in index */ - int ii_NumIndexKeyAttrs; /* number of key columns in index */ + int ii_NumIndexAttrs; AttrNumber ii_KeyAttrNumbers[INDEX_MAX_KEYS]; List *ii_Expressions; /* list of Expr */ List *ii_ExpressionsState; /* list of ExprState */ diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 7038ebb804..714cf1550f 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -1835,8 +1835,7 @@ typedef struct Constraint char *cooked_expr; /* expr, as nodeToString representation */ /* Fields used for unique constraints (UNIQUE and PRIMARY KEY): */ - List *keys; /* String nodes naming referenced key column(s) */ - List *including; /* String nodes naming referenced nonkey column(s) */ + List *keys; /* String nodes naming referenced column(s) */ /* Fields used for EXCLUSION constraints: */ List *exclusions; /* list of (IndexElem, operator name) pairs */ @@ -2440,8 +2439,6 @@ typedef struct IndexStmt char *accessMethod; /* name of access method (eg. btree) */ char *tableSpace; /* tablespace, or NULL for default */ List *indexParams; /* columns to index: a list of IndexElem */ - List *indexIncludingParams; /* additional columns to index: - * a list of IndexElem */ List *options; /* WITH clause options: a list of DefElem */ Node *whereClause; /* qualification (partial-index predicate) */ List *excludeOpNames; /* exclusion operator names, or NIL if none */ diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index 9bfeedaf57..e9dfb663c2 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -545,12 +545,11 @@ typedef struct RelOptInfo * IndexOptInfo * Per-index information for planning/optimization * - * indexkeys[], indexcollations[] each have ncolumns entries. - * opfamily[], and opcintype[] each have nkeycolumns entries. They do - * not contain any information about included attributes. + * indexkeys[], indexcollations[], opfamily[], and opcintype[] + * each have ncolumns entries. * - * sortopfamily[], reverse_sort[], and nulls_first[] have - * nkeycolumns entries, if the index is ordered; but if it is unordered, + * sortopfamily[], reverse_sort[], and nulls_first[] likewise have + * ncolumns entries, if the index is ordered; but if it is unordered, * those pointers are NULL. * * Zeroes in the indexkeys[] array indicate index columns that are @@ -587,9 +586,7 @@ typedef struct IndexOptInfo /* index descriptor information */ int ncolumns; /* number of columns in index */ - int nkeycolumns; /* number of key columns in index */ - int *indexkeys; /* column numbers of index's attributes - * both key and included columns, or 0 */ + int *indexkeys; /* column numbers of index's keys, or 0 */ Oid *indexcollations; /* OIDs of collations of index columns */ Oid *opfamily; /* OIDs of operator families for columns */ Oid *opcintype; /* OIDs of opclass declared input data types */ diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 6ff4b2c5ea..c7582c2a11 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -341,25 +341,11 @@ typedef struct ViewOptions /* * RelationGetNumberOfAttributes - * Returns the total number of attributes in a relation. + * Returns the number of attributes in a relation. */ #define RelationGetNumberOfAttributes(relation) ((relation)->rd_rel->relnatts) /* - * IndexRelationGetNumberOfAttributes - * Returns the number of attributes in an index. - */ -#define IndexRelationGetNumberOfAttributes(relation) \ - ((relation)->rd_index->indnatts) - -/* - * IndexRelationGetNumberOfKeyAttributes - * Returns the number of key attributes in an index. - */ -#define IndexRelationGetNumberOfKeyAttributes(relation) \ - ((relation)->rd_index->indnkeyatts) - -/* * RelationGetDescr * Returns tuple descriptor for a relation. */ |
