Re: [PATCH] pg_ctl should not truncate command lines at 1024 characters
Phil Krylov <phil@krylov.eu>
From: Phil Krylov <phil@krylov.eu>
To: Ranier Vilela <ranier.vf@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2021-09-02T22:57:16Z
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.
Commits
-
Remove arbitrary MAXPGPATH limit on command lengths in pg_ctl.
- 9a070c658906 9.6.24 landed
- 6e2f4581781b 10.19 landed
- beb404d3b165 11.14 landed
- 87ad491472d6 15.0 landed
- 742b30caee65 13.5 landed
- 69d670e68ec9 14.0 landed
- 3b302eb1ea2e 12.9 landed