pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Phil Krylov <phil@krylov.eu>
To: Ranier Vilela <ranier.vf@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] pg_ctl should not truncate command lines at 1024 characters
Date: Fri, 03 Sep 2021 00:57:16 +0200
Message-ID: <b6de877995242870dbff8286f76b7ffa@krylov.eu> (raw)
In-Reply-To: <CAEudQApwuj7Os3Z5kjaR21Ha2_-q4_tBAe=2-0Li3-DcBzavXA@mail.gmail.com>
References: <567e199c6b97ee19deee600311515b86@krylov.eu>
	<CAEudQApwuj7Os3Z5kjaR21Ha2_-q4_tBAe=2-0Li3-DcBzavXA@mail.gmail.com>

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.





view thread (6+ messages)  latest in thread

Message-ID: <b6de877995242870dbff8286f76b7ffa@krylov.eu>
Permalink:  ../b6de877995242870dbff8286f76b7ffa@krylov.eu/
Also on:    postgresql.org/message-id/b6de877995242870dbff8286f76b7ffa@krylov.eu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: phil@krylov.eu, ranier.vf@gmail.com
  Subject: Re: [PATCH] pg_ctl should not truncate command lines at 1024 characters
  In-Reply-To: <b6de877995242870dbff8286f76b7ffa@krylov.eu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox