*** pgsql/src/backend/commands/indexcmds.c	2009/02/02 19:31:38	1.182
--- pgsql/src/backend/commands/indexcmds.c	2009/03/31 22:12:47	1.183
***************
*** 8,14 ****
   *
   *
   * IDENTIFICATION
!  *	  $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.181 2009/01/01 17:23:38 momjian Exp $
   *
   *-------------------------------------------------------------------------
   */
--- 8,14 ----
   *
   *
   * IDENTIFICATION
!  *	  $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.182 2009/02/02 19:31:38 alvherre Exp $
   *
   *-------------------------------------------------------------------------
   */
*************** DefineIndex(RangeVar *heapRelation,
*** 175,181 ****
  	/*
  	 * Don't try to CREATE INDEX on temp tables of other backends.
  	 */
! 	if (isOtherTempNamespace(namespaceId))
  		ereport(ERROR,
  				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
  				 errmsg("cannot create indexes on temporary tables of other sessions")));
--- 175,181 ----
  	/*
  	 * Don't try to CREATE INDEX on temp tables of other backends.
  	 */
! 	if (RELATION_IS_OTHER_TEMP(rel))
  		ereport(ERROR,
  				(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
  				 errmsg("cannot create indexes on temporary tables of other sessions")));
*************** ReindexDatabase(const char *databaseName
*** 1404,1410 ****
  			continue;
  
  		/* Skip temp tables of other backends; we can't reindex them at all */
! 		if (isOtherTempNamespace(classtuple->relnamespace))
  			continue;
  
  		/* Check user/system classification, and optionally skip */
--- 1404,1411 ----
  			continue;
  
  		/* Skip temp tables of other backends; we can't reindex them at all */
! 		if (classtuple->relistemp &&
! 			!isTempNamespace(classtuple->relnamespace))
  			continue;
  
  		/* Check user/system classification, and optionally skip */