*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.161 2007/07/17 05:02:00 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.162 2007/08/25 19:08:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
relationId, accessMethodName, accessMethodId,
amcanorder, isconstraint);
- heap_close(rel, NoLock);
-
/*
* Report index creation if appropriate (delay this till after most of the
* error checks)
primary ? "PRIMARY KEY" : "UNIQUE",
indexRelationName, RelationGetRelationName(rel))));
+ /* save lockrelid for below, then close rel */
+ heaprelid = rel->rd_lockInfo.lockRelId;
+ heap_close(rel, NoLock);
+
indexRelationId =
index_create(relationId, indexRelationName, indexRelationId,
indexInfo, accessMethodId, tablespaceId, classObjectId,
* because there are no operations that could change its state while we
* hold lock on the parent table. This might need to change later.
*/
- heaprelid = rel->rd_lockInfo.lockRelId;
LockRelationIdForSession(&heaprelid, ShareUpdateExclusiveLock);
CommitTransactionCommand();