pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_stat_activity's client_addr column contains "::1" but actually comes from elsewhere?
4+ messages / 3 participants
[nested] [flat]
* pg_stat_activity's client_addr column contains "::1" but actually comes from elsewhere?
@ 2020-11-16 20:12 Edward J. Sabol <edwardjsabol@gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Edward J. Sabol @ 2020-11-16 20:12 UTC (permalink / raw)
To: pgsql-admin
Hello! I'm trying to track down where some connections are coming from. "select pid,client_addr,client_hostname from pg_stat_activity" shows multiple entries with values with client_addr = "::1". "client_hostname" is blank for all entries, by the way, and unhelpful in this scenario. Also, "state" is "idle" for these entries I'm interested in, in case that matters.
::1 would imply the IPv6 loopback address, so that means the connection is coming from a process on the server, right? But I'm positive there is no process on this server that is connecting to PostgreSQL (other than my psql session).
So where are they actually coming from and why is PostgreSQL seemingly misreporting them as coming from ::1?
Thanks for any help,
Ed
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_stat_activity's client_addr column contains "::1" but actually comes from elsewhere?
@ 2020-11-16 21:49 Tom Lane <tgl@sss.pgh.pa.us>
parent: Edward J. Sabol <edwardjsabol@gmail.com>
1 sibling, 1 reply; 4+ messages in thread
From: Tom Lane @ 2020-11-16 21:49 UTC (permalink / raw)
To: Edward J. Sabol <edwardjsabol@gmail.com>; +Cc: pgsql-admin
"Edward J. Sabol" <edwardjsabol@gmail.com> writes:
> Hello! I'm trying to track down where some connections are coming from. "select pid,client_addr,client_hostname from pg_stat_activity" shows multiple entries with values with client_addr = "::1". "client_hostname" is blank for all entries, by the way, and unhelpful in this scenario. Also, "state" is "idle" for these entries I'm interested in, in case that matters.
> ::1 would imply the IPv6 loopback address, so that means the connection is coming from a process on the server, right? But I'm positive there is no process on this server that is connecting to PostgreSQL (other than my psql session).
> So where are they actually coming from and why is PostgreSQL seemingly misreporting them as coming from ::1?
Well, unless the kernel is lying to us, that is where the connection
came from. Perhaps snooping around with netstat and lsof (if you have
it) would be helpful.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_stat_activity's client_addr column contains "::1" but actually comes from elsewhere?
@ 2020-11-16 22:06 Edward J. Sabol <edwardjsabol@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 4+ messages in thread
From: Edward J. Sabol @ 2020-11-16 22:06 UTC (permalink / raw)
To: pgsql-admin
On Nov 16, 2020, at 4:49 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Edward J. Sabol" <edwardjsabol@gmail.com> writes:
>> Hello! I'm trying to track down where some connections are coming from. "select pid,client_addr,client_hostname from pg_stat_activity" shows multiple entries with values with client_addr = "::1". "client_hostname" is blank for all entries, by the way, and unhelpful in this scenario. Also, "state" is "idle" for these entries I'm interested in, in case that matters.
>> ::1 would imply the IPv6 loopback address, so that means the connection is coming from a process on the server, right? But I'm positive there is no process on this server that is connecting to PostgreSQL (other than my psql session).
>
>> So where are they actually coming from and why is PostgreSQL seemingly misreporting them as coming from ::1?
>
> Well, unless the kernel is lying to us, that is where the connection
> came from. Perhaps snooping around with netstat and lsof (if you have
> it) would be helpful.
Thanks for the reply. We figured out. One of our developers was using an ssh tunnel and connecting over that.
Regards,
Ed
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: pg_stat_activity's client_addr column contains "::1" but actually comes from elsewhere?
@ 2020-11-16 22:27 Jeff Janes <jeff.janes@gmail.com>
parent: Edward J. Sabol <edwardjsabol@gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: Jeff Janes @ 2020-11-16 22:27 UTC (permalink / raw)
To: Edward J. Sabol <edwardjsabol@gmail.com>; +Cc: pgsql-admin
On Mon, Nov 16, 2020 at 4:08 PM Edward J. Sabol <edwardjsabol@gmail.com>
wrote:
> Hello! I'm trying to track down where some connections are coming from.
> "select pid,client_addr,client_hostname from pg_stat_activity" shows
> multiple entries with values with client_addr = "::1". "client_hostname" is
> blank for all entries, by the way, and unhelpful in this scenario. Also,
> "state" is "idle" for these entries I'm interested in, in case that matters.
>
> ::1 would imply the IPv6 loopback address, so that means the connection is
> coming from a process on the server, right? But I'm positive there is no
> process on this server that is connecting to PostgreSQL (other than my psql
> session).
>
It could be connected through an SSH tunnel, that will look like it is
coming in over the loopback device.
Cheers,
Jeff
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2020-11-16 22:27 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 20:12 pg_stat_activity's client_addr column contains "::1" but actually comes from elsewhere? Edward J. Sabol <edwardjsabol@gmail.com>
2020-11-16 21:49 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-11-16 22:06 ` Edward J. Sabol <edwardjsabol@gmail.com>
2020-11-16 22:27 ` Jeff Janes <jeff.janes@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