COPY and "pg_ctl -m fast stop"

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: COPY and "pg_ctl -m fast stop"
Date: 2009-03-11 22:02:44
Message-ID: 1236808964.630.17.camel@dell.linuxdev.us.dell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Joshua Tolley 2009-03-11 22:42:40 Re: Sync 2 tables in 2 databases
Previous Message Adrian Klaver 2009-03-11 21:29:21 Re: Enable user access from remote host