Re: [HACKERS] Path-length follies

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Path-length follies
Date: 1999-11-08 21:19:50
Message-ID: Pine.LNX.4.20.9911082214050.4161-100000@peter-e.yi.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1999-11-06, Tom Lane mentioned:

> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Which would lead one to suggest the following as portable as possible way
> > out:
>
> > #if defined(PATH_MAX)
> > #define MAXPGPATH PATH_MAX
> > #else
> > #if defined(MAXPATHLEN)
> > #define MAXPGPATH MAXPATHLEN
> > #else
> > #define MAXPGPATH 255 /* because this is the lowest common
> > denominator on Posix systems */
> > #endif
> > #endif
>
> I don't think this would be an improvement. The main problem with it is

That's why I suggested:

#ifndef PATH_MAX
#define PATH_MAX 255
#endif

instead. Then remove all references to MAXPATHLEN and MAXPGPATH. That can
be done rather quickly. The above is standardized and then we'll have a
uniform limit throughout the source, that should be equal to the actual
system limit on 99% of all systems. And it makes the source simpler along
the way. As it is right now, the vast majority of files doesn't use
MAXPGPATH anyway.

Of course, this is a stupid topic to discuss, but please consider the
point.

> However, this line of thought does lead to something that maybe we
> should change: right now, most of the source files are set up as
>
> #include <all necessary system header files>
>
> #include "postgres.h"
>
> #include "necessary postgres headers"
>
> where config.h is read as part of postgres.h. I wonder whether it's
> such a good idea to have different source files reading different
> sets of system headers before config.h. Maybe the standard order
> ought to be
>
> #include "postgres.h"
>
> #include <all necessary system header files>
>
> #include "necessary postgres headers"
>
> so that config.h is always read in a uniform context.

Definitely.

--
Peter Eisentraut Sernanders vaeg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-11-08 21:22:19 Re: [HACKERS] New psql input mode problems
Previous Message Peter Eisentraut 1999-11-08 21:08:37 Re: [HACKERS] New psql input mode problems