Re: In MacOS, psql reacts on SIGINT in a strange fashion (Linux is fine)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Koterov <dmitry(dot)koterov(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: In MacOS, psql reacts on SIGINT in a strange fashion (Linux is fine)
Date: 2024-04-13 14:53:53
Message-ID: 62348.1713020033@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dmitry Koterov <dmitry(dot)koterov(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2024-04-13 16:22:55 Identify huge pages accessibility using madvise
Previous Message Tom Lane 2024-04-13 14:42:46 Re: Why is parula failing?