]> begriffs open source - ai-pg/blob - full-docs/man1/vacuumlo.1
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man1 / vacuumlo.1
1 '\" t
2 .\"     Title: vacuumlo
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "VACUUMLO" "1" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 vacuumlo \- remove orphaned large objects from a PostgreSQL database
32 .SH "SYNOPSIS"
33 .HP \w'\fBvacuumlo\fR\ 'u
34 \fBvacuumlo\fR [\fIoption\fR...] \fIdbname\fR...
35 .SH "DESCRIPTION"
36 .PP
37 vacuumlo
38 is a simple utility program that will remove any
39 \(lqorphaned\(rq
40 large objects from a
41 PostgreSQL
42 database\&. An orphaned large object (LO) is considered to be any LO whose OID does not appear in any
43 oid
44 or
45 lo
46 data column of the database\&.
47 .PP
48 If you use this, you may also be interested in the
49 \fBlo_manage\fR
50 trigger in the
51 lo
52 module\&.
53 \fBlo_manage\fR
54 is useful to try to avoid creating orphaned LOs in the first place\&.
55 .PP
56 All databases named on the command line are processed\&.
57 .SH "OPTIONS"
58 .PP
59 vacuumlo
60 accepts the following command\-line arguments:
61 .PP
62 \fB\-l \fR\fB\fIlimit\fR\fR
63 .br
64 \fB\-\-limit=\fR\fB\fIlimit\fR\fR
65 .RS 4
66 Remove no more than
67 \fIlimit\fR
68 large objects per transaction (default 1000)\&. Since the server acquires a lock per LO removed, removing too many LOs in one transaction risks exceeding
69 max_locks_per_transaction\&. Set the limit to zero if you want all removals done in a single transaction\&.
70 .RE
71 .PP
72 \fB\-n\fR
73 .br
74 \fB\-\-dry\-run\fR
75 .RS 4
76 Don\*(Aqt remove anything, just show what would be done\&.
77 .RE
78 .PP
79 \fB\-v\fR
80 .br
81 \fB\-\-verbose\fR
82 .RS 4
83 Write a lot of progress messages\&.
84 .RE
85 .PP
86 \fB\-V\fR
87 .br
88 \fB\-\-version\fR
89 .RS 4
90 Print the
91 vacuumlo
92 version and exit\&.
93 .RE
94 .PP
95 \fB\-?\fR
96 .br
97 \fB\-\-help\fR
98 .RS 4
99 Show help about
100 vacuumlo
101 command line arguments, and exit\&.
102 .RE
103 .PP
104 vacuumlo
105 also accepts the following command\-line arguments for connection parameters:
106 .PP
107 \fB\-h \fR\fB\fIhost\fR\fR
108 .br
109 \fB\-\-host=\fR\fB\fIhost\fR\fR
110 .RS 4
111 Database server\*(Aqs host\&.
112 .RE
113 .PP
114 \fB\-p \fR\fB\fIport\fR\fR
115 .br
116 \fB\-\-port=\fR\fB\fIport\fR\fR
117 .RS 4
118 Database server\*(Aqs port\&.
119 .RE
120 .PP
121 \fB\-U \fR\fB\fIusername\fR\fR
122 .br
123 \fB\-\-username=\fR\fB\fIusername\fR\fR
124 .RS 4
125 User name to connect as\&.
126 .RE
127 .PP
128 \fB\-w\fR
129 .br
130 \fB\-\-no\-password\fR
131 .RS 4
132 Never issue a password prompt\&. If the server requires password authentication and a password is not available by other means such as a
133 \&.pgpass
134 file, the connection attempt will fail\&. This option can be useful in batch jobs and scripts where no user is present to enter a password\&.
135 .RE
136 .PP
137 \fB\-W\fR
138 .br
139 \fB\-\-password\fR
140 .RS 4
141 Force
142 vacuumlo
143 to prompt for a password before connecting to a database\&.
144 .sp
145 This option is never essential, since
146 vacuumlo
147 will automatically prompt for a password if the server demands password authentication\&. However,
148 vacuumlo
149 will waste a connection attempt finding out that the server wants a password\&. In some cases it is worth typing
150 \fB\-W\fR
151 to avoid the extra connection attempt\&.
152 .RE
153 .SH "ENVIRONMENT"
154 .PP
155 \fBPGHOST\fR
156 .br
157 \fBPGPORT\fR
158 .br
159 \fBPGUSER\fR
160 .RS 4
161 Default connection parameters\&.
162 .RE
163 .PP
164 This utility, like most other
165 PostgreSQL
166 utilities, also uses the environment variables supported by
167 libpq
168 (see
169 Section\ \&32.15)\&.
170 .PP
171 The environment variable
172 \fBPG_COLOR\fR
173 specifies whether to use color in diagnostic messages\&. Possible values are
174 always,
175 auto
176 and
177 never\&.
178 .SH "NOTES"
179 .PP
180 vacuumlo
181 works by the following method: First,
182 vacuumlo
183 builds a temporary table which contains all of the OIDs of the large objects in the selected database\&. It then scans through all columns in the database that are of type
184 oid
185 or
186 lo, and removes matching entries from the temporary table\&. (Note: Only types with these names are considered; in particular, domains over them are not considered\&.) The remaining entries in the temporary table identify orphaned LOs\&. These are removed\&.
187 .SH "AUTHOR"
188 .PP
189 Peter Mount
190 <peter@retep\&.org\&.uk>