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 1kenfO-0004Ln-UE for pgsql-admin@arkaria.postgresql.org; Mon, 16 Nov 2020 23:12:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kenfN-0001iD-Qc for pgsql-admin@arkaria.postgresql.org; Mon, 16 Nov 2020 23:12:09 +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 1kemdm-0004Eu-Pu for pgsql-admin@lists.postgresql.org; Mon, 16 Nov 2020 22:06:26 +0000 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kemdj-0006er-Pe for pgsql-admin@postgresql.org; Mon, 16 Nov 2020 22:06:25 +0000 Received: by mail-qt1-x82c.google.com with SMTP id f93so14227334qtb.10 for ; Mon, 16 Nov 2020 14:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=qt/2ibttP8RTuw1t/ZZXC1w5HWXX+ptu5qa8YI+Y96U=; b=beszZJ0aJ6EovfmXVc8S67KUohdyxAQ5cfEZ3pKHCgNoUbHrTat5GNkeJwwy2GaDBF KLD8u7cUNtYpcNRWc+2keBhicnlNBJqT+Hkoc98aA8D3a8kHFRBzHJHsKSqnpY+ZBRiy WUHUPS6jLZ4/8citTQgfXzWZ1wql8+KW6Fa84Qy5RJY25lsE27+F9NlLFp9ncVaKh6e+ 2oOIIZHrWOjlqKlUUkXVRY2kdk+2I0AU2zhN4KlsUXAEMx1TmLnpR/xOzzW0C55Sinyn PCjwEBGkfn46r4MA5F5KjYMx9xosckWhzoimLTzDsO51R71GHjZjYm/MFMvyJfeuOpJo lnbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=qt/2ibttP8RTuw1t/ZZXC1w5HWXX+ptu5qa8YI+Y96U=; b=GC99gm0omxoo3gaN5cxgsXc10VNEhQGQHY8bkjIeZ4IbfuElZpAJiM6nvOLWfVwX10 fO4GFz7heK/YGDr7UGW2oYDuPJaw7v7bzZVkikHQr56oQdIL57VB6BWqheWJTP14di/O SP7HKyuA7Zy2YVG7bK/bhsLexdcnaHzp+zL6841cFY8scn5dG/qy1EDMCGLODeTSyVzf q06OLg2DkBl6YNtxuDc+q4BLz6lIHrvszeabCQA2P0xuNedSxDQz9D81jYJP+6ozP7sZ QT/r+lnfslZx+laDZe/7ivJDNzrSFfYs9aGtlSKkH9/UyoJ9mUjJVbixrvbSVQJnj13+ Hl0w== X-Gm-Message-State: AOAM532AZUURzMYcCch3GWMNKxdB3LrxsTz446Ks/lar2sQ2xCXWMEmW wxZ6AkFMyZMi/YYJRxfh/jz5o4QLxPU= X-Google-Smtp-Source: ABdhPJwgPKyBPa6iMnp+EK4SjYCNjvlfJMF59H26p+95/+QEi74dx0L4o6P7PCPcJUePz6lObnB2QQ== X-Received: by 2002:ac8:6c5c:: with SMTP id z28mr16017864qtu.314.1605564382664; Mon, 16 Nov 2020 14:06:22 -0800 (PST) Received: from ?IPv6:2601:14b:4303:20ae:4da0:1c74:d63e:b06c? ([2601:14b:4303:20ae:4da0:1c74:d63e:b06c]) by smtp.gmail.com with ESMTPSA id f56sm13453275qta.49.2020.11.16.14.06.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Nov 2020 14:06:22 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.7\)) Subject: Re: pg_stat_activity's client_addr column contains "::1" but actually comes from elsewhere? From: "Edward J. Sabol" In-Reply-To: <858450.1605563351@sss.pgh.pa.us> Date: Mon, 16 Nov 2020 17:06:20 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <371E399B-8751-4A50-890D-02F899581EB6@gmail.com> <858450.1605563351@sss.pgh.pa.us> To: pgsql-admin@postgresql.org X-Mailer: Apple Mail (2.3445.9.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Nov 16, 2020, at 4:49 PM, Tom Lane wrote: > "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 multiple entries with values with client_addr =3D "::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). >=20 >> So where are they actually coming from and why is PostgreSQL = seemingly misreporting them as coming from ::1? >=20 > 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