vacuumdb cancel handler

Started by ITAGAKI Takahiroover 19 years ago2 messagespatches
Jump to latest
#1ITAGAKI Takahiro
itagaki.takahiro@oss.ntt.co.jp

Hello,

I found vacuumdb, reindexdb and clusterdb don't have cancel handlers.
The server continues to process commands when we press Ctrl+C on those
client programs, though they exit. Therefore, "psql -c VACUUM" and Ctrl+C
works well, but vacuumdb and Ctrl+C does not.

I borrowed the cancel handler from psql and add it into vacuumdb, reindexdb
and clusterdb. Other programs in src/bin/scripts also have the same problem,
but I think it is worth porting only for maintenance commands because they
take long time.

This bug (or spec?) exists in 7.4, 8.0, 8.1 and 8.2. Those commands
were wrappers of psql at 7.3 and we rewrote them into C programs at 7.4.
We might forget to port the feature then.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

Attachments:

vacuumdb_cancel.patchapplication/octet-stream; name=vacuumdb_cancel.patchDownload+197-38
#2Bruce Momjian
bruce@momjian.us
In reply to: ITAGAKI Takahiro (#1)
Re: vacuumdb cancel handler

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------

ITAGAKI Takahiro wrote:

Hello,

I found vacuumdb, reindexdb and clusterdb don't have cancel handlers.
The server continues to process commands when we press Ctrl+C on those
client programs, though they exit. Therefore, "psql -c VACUUM" and Ctrl+C
works well, but vacuumdb and Ctrl+C does not.

I borrowed the cancel handler from psql and add it into vacuumdb, reindexdb
and clusterdb. Other programs in src/bin/scripts also have the same problem,
but I think it is worth porting only for maintenance commands because they
take long time.

This bug (or spec?) exists in 7.4, 8.0, 8.1 and 8.2. Those commands
were wrappers of psql at 7.3 and we rewrote them into C programs at 7.4.
We might forget to port the feature then.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +