Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uQAPv-005zfV-6p for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Jun 2025 19:50:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uQAPq-0054GD-Ur for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Jun 2025 19:50:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uQAPq-0054G5-Jt for pgsql-bugs@lists.postgresql.org; Fri, 13 Jun 2025 19:50:19 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uQAPo-001tTa-37 for pgsql-bugs@lists.postgresql.org; Fri, 13 Jun 2025 19:50:18 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-7c56a3def84so244141385a.0 for ; Fri, 13 Jun 2025 12:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mpcapitallp.com; s=google; t=1749844214; x=1750449014; darn=lists.postgresql.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Ut1sS9HdEwMI8u83EFhkq+kJ1rosqNapU8bJGxhLnn8=; b=MnRy+5gPKbiLPlEOuAaQTKD5aVdocQxMqKXpkbDP/vSuynX80CTtNcLHjhuTDGStLw ZF+Taeh6dJxOceoXFcTwum5v/WvJkPUsiqETSPGJJvfvKSWKrP3k0z7qjQEAfC97GTiH NGyMPj2op9WaRwG+ZTzmo5xU7AFmWYrKx/HLM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749844214; x=1750449014; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Ut1sS9HdEwMI8u83EFhkq+kJ1rosqNapU8bJGxhLnn8=; b=U7/TO59CKK6/FdFz7AYyUpHFvclH5p9KlvsH7TWF5CfeqDKFG8azj4uaocJzLzwvqk /JKcFyiS50Ci90MVc8a8Nwdr/7nAWkel2Q2yDm+STUxld/WXsV/ejrp/zuR+ZZ1Y+Y3k 2gLvWEIIH/RJoetik7kCGEAbhmdKF8Nx8/ELo4sKSVmvvnzc4a2LCT9NZy37s2SeYz1T X+DeKTq0CT8OsATzKXJ5SrFLIASRdtwtoWWl3KiJJo6z8cPiXKiPMVlPG58d0h6yI2K1 uPtaQPevi+FJcch8zlqo8nV3UGTEisleB38s6fZm3HpXR37fb3w9YmsuiUvfdnddI3kP RUtw== X-Gm-Message-State: AOJu0YwKIalQtuEvuJ0692bQPyFcii5g6tNvw05JSx51LnqAi2huQL3s PpCTQ3Tm6RUOsfuWPt4wajhgRDWN9XtQlBPur380XVARm5p5evvcPXjjpLDem92hbu0= X-Gm-Gg: ASbGncudAcJ44Ajx57QivyQwjQqgjGoXbBug8hc6HOwKmnbe9t33BAydtkqs4ZT2bx1 GinHLpBiWqUq7zsHbWXwo6QB6wlbKnZXsmLfbbBogONAnJWgkBpIji8VfrGSfPPNPjUSqlNEKjZ DCYbwjSxkor9Uxml8StRVPU6aElY60gkO/DOjC89QlY7RA9tYzneAvfXI4ftazYrBoqSC9rKYk4 KwGZ29VvBefVPbKrzNRZJ8QzfF02nm18nF9/nh9n1oH+HswYS4EjFWdByDxfEaCFys0L8SJBXxp Hz3U753xqQ1jSvU/d0u3VY3WenApKn20i+6k3aDlCy+u176//zfpnSdROwVsI4NLkoJqTpoUHC0 j+NMO2kiA9KtL90K6FMzep5kWj+doalmYOrQLNZAH+OT41GOdI9MRjA5ZhJE= X-Google-Smtp-Source: AGHT+IEO/oN4S2OVvVy0LCE3qlvI1g2QaZi+SkGlgIFx2AJHDH3uBInQXX5nsS8aOMDDEQnVaovF8A== X-Received: by 2002:a05:620a:2954:b0:7d3:a611:b72f with SMTP id af79cd13be357-7d3c6c08774mr115015785a.2.1749844214414; Fri, 13 Jun 2025 12:50:14 -0700 (PDT) Received: from [192.168.1.11] (pool-71-187-196-198.nwrknj.fios.verizon.net. [71.187.196.198]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7d3b8f2c4d3sm210064685a.116.2025.06.13.12.50.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Jun 2025 12:50:14 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------ep4uXCQGfrRFjeOJGxVO0rQc" Message-ID: Date: Fri, 13 Jun 2025 15:50:11 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #18958: "pg_ctl start" allows subsequent CTRL-C key in cmd.exe to unexpectedly terminate cluster on Windows To: "David G. Johnston" Cc: pgsql-bugs@lists.postgresql.org References: <18958-e398048dd0cdad11@postgresql.org> <076f46d6-edfd-44a0-b8a7-69ee0313a6f4@mpcapitallp.com> Content-Language: en-US From: Seva Zaslavsky In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------ep4uXCQGfrRFjeOJGxVO0rQc Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit All of the behavior I've described in the original bug post regarding CTRL-C terminating the cluster is present in 13.18 - hence contrary to what I asserted earlier, there is no "significant behavior change since PG 13.18." However, the pg_ctl start "--log=filename" option only affects stdout and stderr. I'm still observing the behavior that pressing CTRL-C inside cmd.exe terminates the cluster that was started inside that cmd.exe. According to the documentation for pg_ctl "The server is started in the background, and its standard input is attached to |/dev/null| (or |nul| on Windows)." but if pressing CTRL-C in a cmd.exe window terminates the cluster that was started inside that cmd.exe window, doesn't it seem like stdin is attached to the output cmd.exe and not to NUL? Is it the expected behavior that pressing CTRL-C will terminate the cluster that was started inside that cmd.exe on windows? On 6/13/2025 10:58 AM, David G. Johnston wrote: > On Fri, Jun 13, 2025 at 7:51 AM Seva Zaslavsky > wrote: > > Using the -l flag with "pg_ctl start"  resolves this issue.  This > was a significant behavior change since PG 13.18. > > > I don't recall this changing recently...the documentation hasn't at > least... > > David - Thank you for the quick response.  Would appreciate if you > have any thoughts on another logging bug (or behavior change since > PG 13.18) that I documented on June 11 in #18955. > > That seems Windows OS specific which I'm unable to review and comment > upon. > > David J. > --------------ep4uXCQGfrRFjeOJGxVO0rQc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

All of the behavior I've described in the original bug post regarding CTRL-C terminating the cluster is present in 13.18 - hence contrary to what I asserted earlier, there is no "significant behavior change since PG 13.18."

However, the pg_ctl start "--log=filename" option only affects stdout and stderr.  

I'm still observing the behavior that pressing CTRL-C inside cmd.exe terminates the cluster that was started inside that cmd.exe.

According to the documentation for pg_ctl "The server is started in the background, and its standard input is attached to /dev/null (or nul on Windows)." but if pressing CTRL-C in a cmd.exe window terminates the cluster that was started inside that cmd.exe window, doesn't it seem like stdin is attached to the output cmd.exe and not to NUL?

Is it the expected behavior that pressing CTRL-C will terminate the cluster that was started inside that cmd.exe on windows?

On 6/13/2025 10:58 AM, David G. Johnston wrote:
On Fri, Jun 13, 2025 at 7:51 AM Seva Zaslavsky <szaslavsky@mpcapitallp.com> wrote:

Using the -l flag with "pg_ctl start"  resolves this issue.  This was a significant behavior change since PG 13.18.


I don't recall this changing recently...the documentation hasn't at least...

David - Thank you for the quick response.  Would appreciate if you have any thoughts on another logging bug (or behavior change since PG 13.18) that I documented on June 11 in #18955.

That seems Windows OS specific which I'm unable to review and comment upon.

David J.

--------------ep4uXCQGfrRFjeOJGxVO0rQc--