Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kemNA-0001Nw-V9 for pgsql-admin@arkaria.postgresql.org; Mon, 16 Nov 2020 21:49:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kemN9-0003Xu-Sw for pgsql-admin@arkaria.postgresql.org; Mon, 16 Nov 2020 21:49:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kemN9-0003Xm-L2 for pgsql-admin@lists.postgresql.org; Mon, 16 Nov 2020 21:49:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kemN7-0006X7-Ld for pgsql-admin@postgresql.org; Mon, 16 Nov 2020 21:49:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0AGLnBcT858451; Mon, 16 Nov 2020 16:49:11 -0500 From: Tom Lane To: "Edward J. Sabol" cc: pgsql-admin@postgresql.org Subject: Re: pg_stat_activity's client_addr column contains "::1" but actually comes from elsewhere? In-reply-to: <371E399B-8751-4A50-890D-02F899581EB6@gmail.com> References: <371E399B-8751-4A50-890D-02F899581EB6@gmail.com> Comments: In-reply-to "Edward J. Sabol" message dated "Mon, 16 Nov 2020 15:12:13 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <858449.1605563351.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 16 Nov 2020 16:49:11 -0500 Message-ID: <858450.1605563351@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Edward J. Sabol" 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 multi= ple entries with values with client_addr =3D "::1". "client_hostname" is b= lank for all entries, by the way, and unhelpful in this scenario. Also, "s= tate" 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 n= o process on this server that is connecting to PostgreSQL (other than my p= sql session). > So where are they actually coming from and why is PostgreSQL seemingly m= isreporting 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