Index: src/backend/postmaster/autovacuum.c =================================================================== RCS file: /home/alvherre/cvs/pgsql/src/backend/postmaster/autovacuum.c,v retrieving revision 1.6 diff -c -r1.6 autovacuum.c *** src/backend/postmaster/autovacuum.c 22 Nov 2005 18:17:17 -0000 1.6 --- src/backend/postmaster/autovacuum.c 28 Nov 2005 12:55:26 -0000 *************** *** 898,903 **** --- 898,911 ---- vacstmt->relation = NULL; /* all tables, or not used if relids != NIL */ vacstmt->va_cols = NIL; + /* + * Functions in indexes may want a snapshot set. Note we only need + * to do this in limited cases, because it'll be done in vacuum() + * otherwise. + */ + if (doanalyze && !dovacuum && relids != NIL) + ActiveSnapshot = CopySnapshot(GetTransactionSnapshot()); + vacuum(vacstmt, relids); pfree(vacstmt);