2021年2月22日(月) 8:42 David G. Johnston <david.g.johns...@gmail.com>:

> On Sun, Feb 21, 2021 at 4:38 PM Guyren Howe <guy...@gmail.com> wrote:
>
>> The documentation says that inet_server_addr() does this, but on our
>> servers it is returning nothing.
>>
>
> "Returns the IP address on which the server accepted the current
> connection, or NULL if the current connection is via a Unix-domain socket."
>
> You will need to demonstrate that the connection you are checking from
> isn't being made via a Unix-domain socket.
>

Note also there's a bug in current versions where this function will
erroneously
return NULL if executed by a parallel worker, see [1]. This is fixed in
HEAD but
hasn't been backpatched [2].

[1]
https://www.postgresql.org/message-id/cad21aoat4ahp0uxq91qpd7nl009tnuyqe-b14r3mnsvojte...@mail.gmail.com
[2]
https://git.postgresql.org/pg/commitdiff/5a6f9bce8dabd371bdb4e3db5dda436f7f0a680f


Regards

Ian Barwick

-- 
EnterpriseDB: https://www.enterprisedb.com

Reply via email to