Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cnnP7-000081-SI for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Mar 2017 14:26:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cnnP7-0004TB-8l for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Mar 2017 14:26:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cnnOP-00021l-V4 for pgsql-bugs@postgresql.org; Tue, 14 Mar 2017 14:25:42 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cnnON-0006pt-2S for pgsql-bugs@postgresql.org; Tue, 14 Mar 2017 14:25:41 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v2EEPbD5028846; Tue, 14 Mar 2017 10:25:37 -0400 From: Tom Lane To: "zhaozp@uxsino.com" cc: pgsql-bugs Subject: Re: postmaster.c ,have a warning: pg_getnameinfo_all() failed In-reply-to: <201703141352529603355@uxsino.com> References: <20160418093244.22924.55715@wrigleys.postgresql.org> <201703141352529603355@uxsino.com> Comments: In-reply-to "zhaozp@uxsino.com" message dated "Tue, 14 Mar 2017 13:53:53 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28844.1489501537.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 14 Mar 2017 10:25:37 -0400 Message-ID: <28845.1489501537@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org "zhaozp@uxsino.com" writes: > 4075 char remote_host[NI_MAXHOST]; > 4076 char remote_port[NI_MAXSERV]; > ... > 4135 if ((ret =3D pg_getnameinfo_all(&port->raddr.addr, port->raddr.s= alen, > 4136 remote_host, sizeof(remote_host), > 4137 remote_port, sizeof(remote_port), > 4138 (log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSER= V)) !=3D 0) > Modified below, correct? > 4136 remote_host, NI_MAXHOST, > 4137 remote_port, NI_MAXSERV, Why do you think that's an improvement? The values should be the same, but the existing code doesn't have a hazard of changing the array size in one place and failing to change the other. regards, tom lane --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs