Bruce Momjian writes:
> > Hmm. I think it would make more sense to make the parameter be just
> > the directory, not the full path including filename --- for one thing,
> > doing it like that renders the port-number parameter useless. Why not
> >
> > #define UNIXSOCK_PATH(sun,port,defpath) \
> > snprintf((sun).sun_path, sizeof((sun).sun_path), "%s/.s.PGSQL.%d", \
> > (((defpath) && *(defpath) != '\0') ? (defpath) : "/tmp"), \
> > (port))
>
> I can do that. Of course, I have to now change all the documentation to
> match it. :-)
Rather:
#define UNIXSOCK_PATH(sun,port,defpath) \ snprintf((sun).sun_path, sizeof((sun).sun_path), "%s/.s.PGSQL.%d", \
(defpath), (port))
and make "/tmp" the default in guc.c.
--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/