VACUUM query

Started by news.apexsc.comabout 24 years ago2 messagesgeneral
Jump to latest
#1news.apexsc.com
lance@companywatch.co.uk

System: Linux 6.2; Postgresql 7.1.3
Hi,

can anyone tell me how to:
1. safely abort a VACUUM once it has started?
2. safely abort a scheduled vacuumdb once it has started?

Thanks,

Lance

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: news.apexsc.com (#1)
Re: VACUUM query

"news.apexsc.com" <lance@companywatch.co.uk> writes:

System: Linux 6.2; Postgresql 7.1.3
can anyone tell me how to:
1. safely abort a VACUUM once it has started?
2. safely abort a scheduled vacuumdb once it has started?

In general, you cancel a VACUUM the same way as any other query:
control-C if interactively working in psql, or PQrequestCancel()
in a custom application, or send SIGINT to the individual backend
if you are an admin watching something go nuts.

In 7.1.* there is a known bug that aborting VACUUM partway through
vacuuming a TOAST table may leave things in a bad state. (Actually
there is nothing wrong with the table, but the TOAST code will get
confused because it doesn't check tuple status correctly. Re-vacuuming
will fix it, if you chance to get bit.) So I don't really recommend
doing this on a routine basis, until you update to 7.2.

regards, tom lane