If I open up a session and do:
copy t from stdin;
And then I let the psql session just sit there, not producing data, then
I do a "pg_ctl -m fast stop", then that backend doing the copy doesn't
terminate.
Is this expected behavior? I looked at the code, and it looks like it
ignores an interruption while waiting for data from the client, and
immediately tries to receive data from the socket again.
It seems like there should be some way for "-m fast" to gracefully close
the active connections. Right now, "-m immediate" is required, which
causes nasty log messages and recovery on restart.
Perhaps it could ignore SIGINT while waiting for data from the client,
but respond to SIGTERM?
Regards,
Jeff Davis