COPY and "pg_ctl -m fast stop" - Mailing list pgsql-general

From Jeff Davis
Subject COPY and "pg_ctl -m fast stop"
Date
Msg-id 1236808964.630.17.camel@dell.linuxdev.us.dell.com
Whole thread Raw
List pgsql-general
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


pgsql-general by date:

Previous
From: Joshua Tolley
Date:
Subject: Re: Sync 2 tables in 2 databases
Next
From: "Joshua D. Drake"
Date:
Subject: Re: I don't want to back up index files