*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.21 1998/08/24 01:13:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.22 1999/01/21 22:48:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
DefineIndex(LexIDStr($5),
LexIDStr($3),
LexIDStr($7),
- $9, NIL, 0, 0, NIL);
+ $9, NIL, 0, 0, 0, NIL);
DO_END;
}
;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.66 1998/12/15 12:45:43 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.67 1999/01/21 22:48:05 momjian Exp $
*
*
* INTERFACE ROUTINES
static void UpdateIndexRelation(Oid indexoid, Oid heapoid,
FuncIndexInfo *funcInfo, int natts,
AttrNumber *attNums, Oid *classOids, Node *predicate,
- List *attributeList, bool islossy, bool unique);
+ List *attributeList, bool islossy, bool unique, bool primary);
static void DefaultBuild(Relation heapRelation, Relation indexRelation,
int numberOfAttributes, AttrNumber *attributeNumber,
IndexStrategy indexStrategy, uint16 parameterCount,
Node *predicate,
List *attributeList,
bool islossy,
- bool unique)
+ bool unique,
+ bool primary)
{
Form_pg_index indexForm;
IndexElem *IndexKey;
indexForm->indproc = (PointerIsValid(funcInfo)) ?
FIgetProcOid(funcInfo) : InvalidOid;
indexForm->indislossy = islossy;
+ indexForm->indisprimary = primary;
indexForm->indisunique = unique;
indexForm->indhaskeytype = 0;
Datum *parameter,
Node *predicate,
bool islossy,
- bool unique)
+ bool unique,
+ bool primary)
{
Relation heapRelation;
Relation indexRelation;
*/
UpdateIndexRelation(indexoid, heapoid, funcInfo,
numatts, attNums, classObjectId, predicate,
- attributeList, islossy, unique);
+ attributeList, islossy, unique, primary);
predInfo = (PredInfo *) palloc(sizeof(PredInfo));
predInfo->pred = predicate;
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.34 1998/12/14 05:18:39 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.35 1999/01/21 22:48:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Old_pg_index_Form->indclass,
(uint16) 0, (Datum) NULL, NULL,
Old_pg_index_Form->indislossy,
- Old_pg_index_Form->indisunique);
+ Old_pg_index_Form->indisunique,
+ Old_pg_index_Form->indisprimary);
heap_close(OldIndex);
heap_close(NewHeap);
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.29 1998/12/15 12:45:56 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.30 1999/01/21 22:48:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
List *attributeList,
List *parameterList,
bool unique,
+ bool primary,
Expr *predicate,
List *rangetable)
{
&fInfo, NULL, accessMethodId,
numberOfAttributes, attributeNumberA,
classObjectId, parameterCount, parameterA, (Node *) cnfPred,
- lossy, unique);
+ lossy, unique, primary);
}
else
{
attributeList,
accessMethodId, numberOfAttributes, attributeNumberA,
classObjectId, parameterCount, parameterA, (Node *) cnfPred,
- lossy, unique);
+ lossy, unique, primary);
}
}
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: analyze.c,v 1.93 1999/01/21 16:08:38 vadim Exp $
+ * $Id: analyze.c,v 1.94 1999/01/21 22:48:07 momjian Exp $
*
*-------------------------------------------------------------------------
*/
elog(ERROR, "CREATE TABLE/PRIMARY KEY multiple keys for table %s are not legal", stmt->relname);
have_pkey = TRUE;
+ index->primary = TRUE;
index->idxname = makeTableName(stmt->relname, "pkey", NULL);
}
else
+ {
+ index->primary = FALSE;
index->idxname = NULL;
+ }
index->relname = stmt->relname;
index->accessMethod = "btree";
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.44 1998/12/15 12:46:26 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.45 1999/01/21 22:48:09 momjian Exp $
*
*-------------------------------------------------------------------------
*/
classObjectId[0] = INT4_OPS_OID;
index_create(objname, indname, NULL, NULL, BTREE_AM_OID,
1, &attNums[0], &classObjectId[0],
- 0, (Datum) NULL, NULL, FALSE, FALSE);
+ 0, (Datum) NULL, NULL, FALSE, FALSE, FALSE);
/* make the index visible in this transaction */
CommandCounterIncrement();
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.52 1999/01/17 06:18:44 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.53 1999/01/21 22:48:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
stmt->indexParams, /* parameters */
stmt->withClause,
stmt->unique,
+ 0, /* CREATE INDEX can't be primary */
(Expr *) stmt->whereClause,
stmt->rangetable);
}
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: index.h,v 1.13 1998/09/01 04:34:43 momjian Exp $
+ * $Id: index.h,v 1.14 1999/01/21 22:48:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
Datum *parameter,
Node *predicate,
bool islossy,
- bool unique);
+ bool unique,
+ bool primary);
extern void index_destroy(Oid indexId);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: defrem.h,v 1.13 1998/09/01 04:35:30 momjian Exp $
+ * $Id: defrem.h,v 1.14 1999/01/21 22:48:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
List *attributeList,
List *parameterList,
bool unique,
+ bool primary,
Expr *predicate,
List *rangetable);
extern void ExtendIndex(char *indexRelationName,
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.67 1999/01/21 16:08:55 vadim Exp $
+ * $Id: parsenodes.h,v 1.68 1999/01/21 22:48:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* transformStmt() */
bool *lossy; /* is index lossy? */
bool unique; /* is index unique? */
+ bool primary; /* is index on primary key? */
} IndexStmt;
/* ----------------------