Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tCii8-00BQuv-Fb for pgsql-bugs@arkaria.postgresql.org; Sun, 17 Nov 2024 17:05:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tCii4-000SWd-5x for pgsql-bugs@arkaria.postgresql.org; Sun, 17 Nov 2024 17:05:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tCii3-000SWU-Tp for pgsql-bugs@lists.postgresql.org; Sun, 17 Nov 2024 17:05:16 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tCii1-002NhR-OB for pgsql-bugs@lists.postgresql.org; Sun, 17 Nov 2024 17:05:15 +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 4AHH5BJD3065773; Sun, 17 Nov 2024 12:05:11 -0500 From: Tom Lane To: denis.feklushkin@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18712: inet value ::2 handling goes not as expected In-reply-to: <18712-f787a146022a78e4@postgresql.org> References: <18712-f787a146022a78e4@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sat, 16 Nov 2024 06:50:10 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3065771.1731863111.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 17 Nov 2024 12:05:11 -0500 Message-ID: <3065772.1731863111@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > I think that statement > select '::0.0.0.2'::inet; > should return '::0.0.0.2' value, not '::2' > I think this is what was intended in the Postgres sources. But it seems = that > this line is never executed: > https://github.com/postgres/postgres/blob/7b88529f4363994450bd4cd3c17200= 6a8a77e222/src/port/inet_net_ntop.c#L260 Hmm ... you are right that that code doesn't do what it seems to intend to, because by the time that we get to this logic we have i =3D=3D 7 not i =3D=3D 6. But I'm not sure if we should change it after all this time. We're about as likely to get complaints as kudos, I fear. And the output isn't incorrect, just not-per-style. I wonder whether ISC ever changed their version? regards, tom lane