Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
92244e8e
Commit
92244e8e
authored
20 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Fix some minor issues with the new Win32 service code for autovacuum,
and add documentation. Dave Page
parent
b04e70b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/pg_autovacuum/README.pg_autovacuum
+25
-1
25 additions, 1 deletion
contrib/pg_autovacuum/README.pg_autovacuum
contrib/pg_autovacuum/pg_autovacuum.c
+7
-20
7 additions, 20 deletions
contrib/pg_autovacuum/pg_autovacuum.c
with
32 additions
and
21 deletions
contrib/pg_autovacuum/README.pg_autovacuum
+
25
−
1
View file @
92244e8e
...
...
@@ -55,6 +55,15 @@ postmasters on a particular host, you will need multiple pg_autovacuum
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 @@ pg_autovacuum has the following optional arguments:
-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 @@ the time of writing they are:
-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:
-------------------
...
...
This diff is collapsed.
Click to expand it.
contrib/pg_autovacuum/pg_autovacuum.c
+
7
−
20
View file @
92244e8e
...
...
@@ -25,12 +25,8 @@ log_entry(const char *logentry, int level)
{
/*
* 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 @@ log_entry(const char *logentry, int level)
}
}
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 @@ InstallService()
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 @@ InstallService()
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
,
"pg
messages
.dll"
);
/* TODO
Try to find pgevent.dll, rather than hope it's in the path.
! */
/* Message
DLL
*/
sprintf
(
szMsgDLL
,
"pg
event
.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
)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment