pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to determine server's own IP address? inet_server_addr not working
3+ messages / 3 participants
[nested] [flat]

* How to determine server's own IP address? inet_server_addr not working
@ 2021-02-21 23:38 Guyren Howe <guyren@gmail.com>
  2021-02-21 23:41 ` Re: How to determine server's own IP address? inet_server_addr not working David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Guyren Howe @ 2021-02-21 23:38 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

The documentation says that inet_server_addr() does this, but on our servers it is returning nothing.=

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: How to determine server's own IP address? inet_server_addr not working
  2021-02-21 23:38 How to determine server's own IP address? inet_server_addr not working Guyren Howe <guyren@gmail.com>
@ 2021-02-21 23:41 ` David G. Johnston <david.g.johnston@gmail.com>
  2021-02-22 06:03   ` Re: How to determine server's own IP address? inet_server_addr not working Ian Lawrence Barwick <barwick@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: David G. Johnston @ 2021-02-21 23:41 UTC (permalink / raw)
  To: Guyren Howe <guyren@gmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On Sun, Feb 21, 2021 at 4:38 PM Guyren Howe <guyren@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.

David J.

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: How to determine server's own IP address? inet_server_addr not working
  2021-02-21 23:38 How to determine server's own IP address? inet_server_addr not working Guyren Howe <guyren@gmail.com>
  2021-02-21 23:41 ` Re: How to determine server's own IP address? inet_server_addr not working David G. Johnston <david.g.johnston@gmail.com>
@ 2021-02-22 06:03   ` Ian Lawrence Barwick <barwick@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Ian Lawrence Barwick @ 2021-02-22 06:03 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Guyren Howe <guyren@gmail.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

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

> On Sun, Feb 21, 2021 at 4:38 PM Guyren Howe <guyren@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-b14R3MnSVOjtE71g@mail.gmail...
[2]
https://git.postgresql.org/pg/commitdiff/5a6f9bce8dabd371bdb4e3db5dda436f7f0a680f


Regards

Ian Barwick

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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-02-22 06:03 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-21 23:38 How to determine server's own IP address? inet_server_addr not working Guyren Howe <guyren@gmail.com>
2021-02-21 23:41 ` David G. Johnston <david.g.johnston@gmail.com>
2021-02-22 06:03   ` Ian Lawrence Barwick <barwick@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox