Dmitry Koterov <dmitry.kote...@gmail.com> writes: > I almost lost my mind today trying to figure out why sending a SIGINT > precisely to a psql interactive process delivers this SIGINT not only to > that psql, but also to its parents.
Let me guess ... you're using zsh not bash? I do not use zsh myself, but what I read in its man page suggests that this is its designed behavior. The kill command says its arguments are "jobs", and elsewhere it says There are several ways to refer to jobs in the shell. A job can be referred to by the process ID of any process of the job or by one of the following: ... so I suspect zsh is treating that stack of processes as a "job" and zapping all of it. There is certainly nothing in psql that would attempt to signal its parent process (let alone grandparent). regards, tom lane