diff options
| author | Alvaro Herrera | 2007-01-16 13:28:57 +0000 |
|---|---|---|
| committer | Alvaro Herrera | 2007-01-16 13:28:57 +0000 |
| commit | eb63cc3da82cec03c54a9534a6c91d287078abd1 (patch) | |
| tree | a8181fbd037cc02c1eeb68202b8632b20f536665 /src/include | |
| parent | 02609893da8cac7689ec5173bc7d815e6f27ad2e (diff) | |
Arrange for autovacuum to be killed when another operation wants to be alone
accessing it, like DROP DATABASE. This allows the regression tests to pass
with autovacuum enabled, which open the gates for finally enabling autovacuum
by default.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/postmaster/autovacuum.h | 3 | ||||
| -rw-r--r-- | src/include/storage/proc.h | 3 | ||||
| -rw-r--r-- | src/include/storage/procarray.h | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/include/postmaster/autovacuum.h b/src/include/postmaster/autovacuum.h index c232ae3b48..7b3ad7e550 100644 --- a/src/include/postmaster/autovacuum.h +++ b/src/include/postmaster/autovacuum.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/postmaster/autovacuum.h,v 1.6 2007/01/05 22:19:57 momjian Exp $ + * $PostgreSQL: pgsql/src/include/postmaster/autovacuum.h,v 1.7 2007/01/16 13:28:57 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -36,6 +36,7 @@ extern void autovac_stopped(void); #ifdef EXEC_BACKEND extern void AutoVacMain(int argc, char *argv[]); +extern void AutovacuumIAm(void); #endif #endif /* AUTOVACUUM_H */ diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index a52850fb21..b86f210fbe 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.92 2007/01/05 22:19:58 momjian Exp $ + * $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.93 2007/01/16 13:28:57 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -75,6 +75,7 @@ struct PGPROC Oid roleId; /* OID of role using this backend */ bool inVacuum; /* true if current xact is a LAZY VACUUM */ + bool isAutovacuum; /* true if it's autovacuum */ /* Info about LWLock the process is currently waiting for, if any. */ bool lwWaiting; /* true if waiting for an LW lock */ diff --git a/src/include/storage/procarray.h b/src/include/storage/procarray.h index 265f4eb0b7..93e82e4368 100644 --- a/src/include/storage/procarray.h +++ b/src/include/storage/procarray.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/procarray.h,v 1.11 2007/01/05 22:19:58 momjian Exp $ + * $PostgreSQL: pgsql/src/include/storage/procarray.h,v 1.12 2007/01/16 13:28:57 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -29,7 +29,7 @@ extern TransactionId GetOldestXmin(bool allDbs, bool ignoreVacuum); extern PGPROC *BackendPidGetProc(int pid); extern int BackendXidGetPid(TransactionId xid); extern bool IsBackendPid(int pid); -extern bool DatabaseHasActiveBackends(Oid databaseId, bool ignoreMyself); +extern bool DatabaseCancelAutovacuumActivity(Oid databaseId, bool ignoreMyself); extern int CountActiveBackends(void); extern int CountDBBackends(Oid databaseid); |
