diff -ur postgresql-7.1.orig/src/backend/access/nbtree/nbtree.c postgresql-7.1/src/backend/access/nbtree/nbtree.c --- postgresql-7.1.orig/src/backend/access/nbtree/nbtree.c Sat Mar 24 11:54:35 2001 +++ postgresql-7.1/src/backend/access/nbtree/nbtree.c Mon Jul 2 23:52:23 2001 @@ -206,7 +206,8 @@ */ if (oldPred != NULL) { - slot->val = htup; + // Invalid buffer should be ok, index shouldn't go away, i hope + ExecStoreTuple( htup, slot, InvalidBuffer, false ); if (ExecQual((List *) oldPred, econtext, false)) { nitups++; @@ -220,7 +221,8 @@ */ if (pred != NULL) { - slot->val = htup; + // Invalid buffer should be ok, index shouldn't go away, i hope + ExecStoreTuple( htup, slot, InvalidBuffer, false ); if (!ExecQual((List *) pred, econtext, false)) continue; } diff -ur postgresql-7.1.orig/src/backend/optimizer/path/indxpath.c postgresql-7.1/src/backend/optimizer/path/indxpath.c --- postgresql-7.1.orig/src/backend/optimizer/path/indxpath.c Sat Mar 24 11:54:40 2001 +++ postgresql-7.1/src/backend/optimizer/path/indxpath.c Tue Jul 3 21:08:02 2001 @@ -1153,6 +1153,8 @@ ScanKeyData entry[3]; Form_pg_amop aform; + ExprContext *econtext; + pred_var = (Var *) get_leftop(predicate); pred_const = (Const *) get_rightop(predicate); clause_var = (Var *) get_leftop((Expr *) clause); @@ -1302,7 +1304,8 @@ copyObject(clause_const), copyObject(pred_const)); - test_result = ExecEvalExpr((Node *) test_expr, NULL, &isNull, NULL); + econtext = MakeExprContext(NULL, TransactionCommandContext); + test_result = ExecEvalExpr((Node *) test_expr, econtext, &isNull, NULL); if (isNull) { diff -ur postgresql-7.1.orig/src/backend/parser/analyze.c postgresql-7.1/src/backend/parser/analyze.c --- postgresql-7.1.orig/src/backend/parser/analyze.c Sat Mar 24 11:54:42 2001 +++ postgresql-7.1/src/backend/parser/analyze.c Mon Jul 2 21:34:43 2001 @@ -1525,6 +1525,11 @@ { Query *qry; + // no inheritence, yes we can use fields from relation + RangeTblEntry *rte = addRangeTableEntry( pstate, stmt->relname, NULL, false, true ); + // no to join list, yes to namespace + addRTEtoQuery( pstate, rte, false, true ); + qry = makeNode(Query); qry->commandType = CMD_UTILITY; diff -ur postgresql-7.1.orig/src/backend/parser/gram.y postgresql-7.1/src/backend/parser/gram.y --- postgresql-7.1.orig/src/backend/parser/gram.y Sat Feb 24 05:12:06 2001 +++ postgresql-7.1/src/backend/parser/gram.y Fri Jun 29 23:54:52 2001 @@ -2313,7 +2313,7 @@ *****************************************************************************/ IndexStmt: CREATE index_opt_unique INDEX index_name ON relation_name - access_method_clause '(' index_params ')' opt_with + access_method_clause '(' index_params ')' opt_with where_clause { IndexStmt *n = makeNode(IndexStmt); n->unique = $2; @@ -2322,7 +2322,7 @@ n->accessMethod = $7; n->indexParams = $9; n->withClause = $11; - n->whereClause = NULL; + n->whereClause = $12; $$ = (Node *)n; } ;