Re: [PATCH] pg_ctl should not truncate command lines at 1024 characters

From: Phil Krylov <phil(at)krylov(dot)eu>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] pg_ctl should not truncate command lines at 1024 characters
Date: 2021-09-02 22:57:16
Message-ID: b6de877995242870dbff8286f76b7ffa@krylov.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-09-02 23:00:46 Re: dup(0) fails on Ubuntu 20.04 and macOS 10.15 with 13.0
Previous Message Alvaro Herrera 2021-09-02 22:43:33 Re: prevent immature WAL streaming