Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLveD-0007r3-RZ for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Sep 2021 22:57:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mLveC-00041e-5f for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Sep 2021 22:57:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLveB-00041W-Ty for pgsql-hackers@lists.postgresql.org; Thu, 02 Sep 2021 22:57:27 +0000 Received: from [213.136.84.212] (helo=mail.krylov.eu) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLve9-00055r-RW for pgsql-hackers@postgresql.org; Thu, 02 Sep 2021 22:57:26 +0000 Received: from roundcube (roundcube [172.16.15.33]) by mail.krylov.eu (Postfix) with ESMTPSA id DE9C53E1; Fri, 3 Sep 2021 00:57:16 +0200 (CEST) MIME-Version: 1.0 Date: Fri, 03 Sep 2021 00:57:16 +0200 From: Phil Krylov To: Ranier Vilela Cc: Pg Hackers Subject: Re: [PATCH] pg_ctl should not truncate command lines at 1024 characters In-Reply-To: References: <567e199c6b97ee19deee600311515b86@krylov.eu> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: phil@krylov.eu Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 213.136.84.212 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-09-03 00:36, Ranier Vilela wrote: > The msvc docs says that limit for the command line is 32,767 > characters, > while ok for me, I think if not it would be better to check this limit? Well, it's ARG_MAX in POSIX, and ARG_MAX is defined as 256K in Darwin, 512K in FreeBSD, 128K in Linux; _POSIX_ARG_MAX is defined as 4096 on all three platforms. Windows may differ too. Anyways, allocating even 128K in precious stack space is too much, that's why I suggest to use psprintf(). As for checking any hard limit, I don't think it would have much value - somehow we got the original command line, thus it is supported by the system, so we can just pass it on. -- Ph.