Hello Masao-san,
If large scale factor is specified, the query for generating
pgbench_accounts data can take a very long time. While that query is
running, operators may be likely to do Ctrl-C to cancel the data
generation. In this case, IMO pgbench should cancel the query, i.e.,
call PQcancel(). Otherwise, the query will keep running to the end.
Hmmm. Why not. Now the infra to do that seems to already exists twice, once
in "src/bin/psql/common.c" and once in "src/bin/scripts/common.c".
I cannot say I'm thrilled to replicate this once more. I think that the
reasonable option is to share this in fe-utils and then to reuse it from
there. However, ISTM that such a restructuring patch which not belong to this
feature. [...]
I just did a patch to share the code:
https://www.postgresql.org/message-id/flat/alpine.DEB.2.21.1910311939430.27369@lancre
https://commitfest.postgresql.org/25/2336/
--
Fabien.