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

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Phil Krylov <phil(at)krylov(dot)eu>
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:36:08
Message-ID: CAEudQApwuj7Os3Z5kjaR21Ha2_-q4_tBAe=2-0Li3-DcBzavXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em qui., 2 de set. de 2021 às 18:36, Phil Krylov <phil(at)krylov(dot)eu> escreveu:

> Hello,
>
> Lacking a tool to edit postgresql.conf programmatically, people resort
> to passing cluster options on the command line. While passing all
> non-default options in this way may sound like an abuse of the feature,
> IMHO pg_ctl should not blindly truncate generated command lines at
> MAXPGPATH (1024 characters) and then run that, resulting in:
>
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?

> /bin/sh: Syntax error: end of file unexpected (expecting word)
> pg_ctl: could not start server
> Examine the log output.
>
> The attached patch tries to fix it in the least intrusive way.
>
> While we're at it, is it supposed that pg_ctl is a very short-lived
> process and is therefore allowed to leak memory? I've noticed some
> places where I would like to add a free() call.
>
+1 to add free.

regards,
Ranier Vilela

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-09-02 22:43:33 Re: prevent immature WAL streaming
Previous Message Peter Smith 2021-09-02 22:33:49 Re: Added schema level support for publication.