cvs -z9 diff -u pg_autovacuum.c README.pg_autovacuum (in directory C:\Documents and Settings\dpage\My Documents\CVS\pgsql\contrib\pg_autovacuum\) Index: pg_autovacuum.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/contrib/pg_autovacuum/pg_autovacuum.c,v retrieving revision 1.20 diff -u -r1.20 pg_autovacuum.c --- pg_autovacuum.c 30 Aug 2004 03:31:28 -0000 1.20 +++ pg_autovacuum.c 1 Sep 2004 08:36:16 -0000 @@ -25,12 +25,8 @@ { /* * Note: Under Windows we dump the log entries to the normal - * stderr/logfile - */ - - /* - * as well, otherwise it can be a pain to debug service install - * failures etc. + * stderr/logfile as well, otherwise it can be a pain to debug + * service install failures etc. */ time_t curtime; @@ -117,7 +113,7 @@ } } - ReportEvent(evtHandle, elevel, 0, 1, NULL, 1, 0, &logentry, NULL); + ReportEvent(evtHandle, elevel, 0, 0, NULL, 1, 0, &logentry, NULL); #endif } @@ -1219,7 +1215,7 @@ if (args->user) sprintf(szCommand, "%s -U %s", szCommand, args->user); if (args->password) - sprintf(szCommand, "%s -p %s", szCommand, args->password); + sprintf(szCommand, "%s -P %s", szCommand, args->password); if (args->logfile) sprintf(szCommand, "%s -L %s", szCommand, args->logfile); if (args->sleep_base_value != (int) SLEEPBASEVALUE) @@ -1249,21 +1245,12 @@ if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hk, NULL)) return -5; - /* TODO Create an actual message file! */ - /* Message count */ - sprintf(szMsgDLL, "pgmessages.dll"); + /* TODO Try to find pgevent.dll, rather than hope it's in the path. ! */ + /* Message DLL */ + sprintf(szMsgDLL, "pgevent.dll"); if (RegSetValueEx(hk, "EventMessageFile", 0, REG_EXPAND_SZ, (LPBYTE) szMsgDLL, (DWORD) strlen(szMsgDLL) + 1)) return -6; - /* Category message file */ - if (RegSetValueEx(hk, "CategoryMessageFile", 0, REG_EXPAND_SZ, (LPBYTE) szMsgDLL, (DWORD) strlen(szMsgDLL) + 1)) - return -7; - - /* Category message count */ - dwData = 0; - if (RegSetValueEx(hk, "CategoryCount", 0, REG_DWORD, (LPBYTE) & dwData, sizeof(DWORD))) - return -8; - /* Set the event types supported */ dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE | EVENTLOG_SUCCESS; if (RegSetValueEx(hk, "TypesSupported", 0, REG_DWORD, (LPBYTE) & dwData, sizeof(DWORD))) Index: README.pg_autovacuum =================================================================== RCS file: /projects/cvsroot/pgsql-server/contrib/pg_autovacuum/README.pg_autovacuum,v retrieving revision 1.7 diff -u -r1.7 README.pg_autovacuum --- README.pg_autovacuum 19 Apr 2004 21:30:18 -0000 1.7 +++ README.pg_autovacuum 1 Sep 2004 08:36:18 -0000 @@ -55,6 +55,15 @@ instances, and they have no way, at present, to coordinate between one another to ensure that they do not concurrently vacuum big tables. +When installed as a service under Windows, there is currently no way to +know the name of the PostgreSQL server service (if there even is one) +so it is not possible to specify a startup dependency. It is therefore +possible for pg_autovacuum to start before the server. + +When installed as a service under Windows, if the -P option is used to +specify the connection password, this option (and the password) is +stored in plain text in the registry. + TODO: ----- @@ -117,7 +126,9 @@ -L log file: Name of file to which output is submitted, otherwise STDERR -U username: Username pg_autovacuum will use to connect with, if not specified the current username is used. --P password: Password pg_autovacuum will use to connect with. +-P password: Password pg_autovacuum will use to connect with. *WARNING* + When installed as a Windows Service, this option will be stored in plain + text in the registry. -H host: host name or IP to connect to. -p port: port used for connection. -h help: list of command line options. @@ -133,6 +144,19 @@ -s 300 (5 minutes) -S 2 +The following arguments are used on Windows only: + +-I Install the executable as a Windows service. Other appropriate command + line options will be stored in the registry and passed to the service + at startup. *WARNING* This includes the connection password which will + be stored in plain text. + +-N service user: Name of the Windows user account under which the service + will run. + +-W service password: The password for the service account. + +-R Uninstall pg_autovacuum as a service. Vacuum and Analyze: -------------------