Re: pgsql: Enable Unix-domain sockets support on Windows

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Enable Unix-domain sockets support on Windows
Date: 2020-06-27 11:57:20
Message-ID: CAA4eK1KaTu3_CTAdKON_P4FB=-uvNkviJpqYkhLFcmb8xZkk_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Sat, Jun 27, 2020 at 3:06 PM Peter Eisentraut
<peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
>
> On 2020-06-26 14:21, Amit Kapila wrote:
> > On Sat, Mar 28, 2020 at 7:37 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
> >>
> >> Enable Unix-domain sockets support on Windows
> >>
> >
> > +
> > +/*
> > + * Windows headers don't define this structure, but you can define it yourself
> > + * to use the functionality.
> > + */
> > +struct sockaddr_un
> > +{
> > + unsigned short sun_family;
> > + char sun_path[108];
> > +};
> >
> > I was going through this feature and reading about Windows support for
> > it. I came across a few links which suggest that this structure is
> > defined in <afunix.h>. Is there a reason for not using this via
> > afunix.h?
> >
> > [1] - https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/
> > [2] - https://gist.github.com/NZSmartie/079d8f894ee94f3035306cb23d49addc
>
> If we did it that way we'd have to write some kind of configuration-time
> check for the MSVC build, since not all Windows versions have that
> header. Also, not all versions of MinGW have that header (possibly
> none). So the current implementation is probably the most practical
> compromise.
>

Fair enough, but what should be the behavior in the Windows versions
(<10) where Unix-domain sockets are not supported? BTW, in which
format the path needs to be specified for unix_socket_directories? I
tried with '/c/tmp', 'c:/tmp', 'tmp' but nothing seems to be working,
it gives me errors like: "could not create lock file
"/c/tmp/.s.PGSQL.5432.lock": No such file or directory" on server
start. I am trying this on Win7 just to check what is the behavior of
this feature on it.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-06-27 16:48:12 pgsql: Add hints about protocol-version-related SSL connection failures
Previous Message Peter Eisentraut 2020-06-27 09:36:10 Re: pgsql: Enable Unix-domain sockets support on Windows

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-06-27 12:30:37 Re: Fwd: PostgreSQL: WolfSSL support
Previous Message Tomas Vondra 2020-06-27 10:41:41 Re: Default setting for enable_hashagg_disk