Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Jun 15, 2022 at 2:51 AM Peter Eisentraut
> <peter.eisentraut@enterprisedb.com> wrote:
>> We have this problem of long file names being silently truncated all
>> over the source code. Instead of equipping each one of them with a
>> length check, why don't we get rid of the fixed-size buffers and
>> allocate dynamically, as in the attached patch.
> I don't know how much we gain by fixing one place and not all the
> others, but maybe it would set a trend.
Yeah, that was what was bugging me about this proposal. Removing
one function's dependency on MAXPGPATH isn't much of a step forward.
I note also that the patch leaks quite a lot of memory (a kilobyte or
so per pathname, IIRC). That's probably negligible in this particular
context, but anyplace that was called more than once per program run
would need to be more tidy.
regards, tom lane