Обсуждение: pgsql-server/src/interfaces/libpq Makefile

Поиск
Список
Период
Сортировка

pgsql-server/src/interfaces/libpq Makefile

От
momjian@postgresql.org (Bruce Momjian - CVS)
Дата:
CVSROOT:    /cvsroot
Module name:    pgsql-server
Changes by:    momjian@postgresql.org    03/04/21 22:21:34

Modified files:
    src/interfaces/libpq: Makefile

Log message:
    Add dirmod to libpq Makefile.


Re: pgsql-server/src/interfaces/libpq Makefile

От
Tom Lane
Дата:
momjian@postgresql.org (Bruce Momjian - CVS) writes:
> Modified files:
>     src/interfaces/libpq: Makefile

> Log message:
>     Add dirmod to libpq Makefile.

Why?  libpq doesn't use rename, and I don't think it should be using
unlink (someone *please* tell me that that unlink in getaddrinfo_unix
is a brain-dead error...)

            regards, tom lane


Re: pgsql-server/src/interfaces/libpq Makefile

От
Bruce Momjian
Дата:
Tom Lane wrote:
> momjian@postgresql.org (Bruce Momjian - CVS) writes:
> > Modified files:
> >     src/interfaces/libpq: Makefile
>
> > Log message:
> >     Add dirmod to libpq Makefile.
>
> Why?  libpq doesn't use rename, and I don't think it should be using

Also, keep in mind that it will effect other clients who do use
rename/unlink.  The question is whether they assume Unix semantics on
those commands.  I don't know the answer, but I assumed they did.

> unlink (someone *please* tell me that that unlink in getaddrinfo_unix
> is a brain-dead error...)

Not sure --- that's why I added it.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073


Re: pgsql-server/src/interfaces/libpq Makefile

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> Why?  libpq doesn't use rename, and I don't think it should be using

> Also, keep in mind that it will effect other clients who do use
> rename/unlink.  The question is whether they assume Unix semantics on
> those commands.  I don't know the answer, but I assumed they did.

I don't believe any of our standard clients care, and in any case libpq
is not the place to put it if they do.

>> unlink (someone *please* tell me that that unlink in getaddrinfo_unix
>> is a brain-dead error...)

> Not sure --- that's why I added it.

Even if it's correct (which I doubt) it's inside #ifdef
HAVE_UNIX_SOCKETS and therefore irrelevant to Windows.

            regards, tom lane


Re: pgsql-server/src/interfaces/libpq Makefile

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> unlink (someone *please* tell me that that unlink in getaddrinfo_unix
>> is a brain-dead error...)

> Not sure --- that's why I added it.

After further research I conclude it is at best unnecessary and at worst
dangerous.  It is unnecessary because Lock_AF_UNIX() will alreay have
unlink'ed any pre-existing socket file in the postmaster-startup case.
It is dangerous because there is no reason that anyone would expect
getaddrinfo() to have destructive side-effects.  Certainly the
discussion of the AI_PASSIVE flag in the Linux manpage for getaddrinfo
doesn't suggest any such thing.

I'm going to remove it.

            regards, tom lane