Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yb9lI-0003hf-1g for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Mar 2015 15:32:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yb9lH-0001UI-HB for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Mar 2015 15:31:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yb9lG-0001UB-Ie for pgsql-bugs@postgresql.org; Thu, 26 Mar 2015 15:31:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Yb9lC-0003Ym-6S for pgsql-bugs@postgresql.org; Thu, 26 Mar 2015 15:31:57 +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 t2QFVptK008170; Thu, 26 Mar 2015 11:31:51 -0400 From: Tom Lane To: Duncan Smith cc: pgsql-bugs@postgresql.org Subject: Re: Wire protocol encoding for 'inet' type is defined unreliably In-reply-to: <1427322818.3613692.245294397.12EB3E23@webmail.messagingengine.com> References: <1427322818.3613692.245294397.12EB3E23@webmail.messagingengine.com> Comments: In-reply-to Duncan Smith message dated "Wed, 25 Mar 2015 15:33:38 -0700" Date: Thu, 26 Mar 2015 11:31:51 -0400 Message-ID: <8169.1427383911@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 Duncan Smith writes: > I noticed today that the network encoding of the 'inet' type uses values > derived from the system header file to tag whether the > address is IPv4 or IPv6. > In particular, defines PGSQL_AF_INET to be > AF_INET, which is 2 on my system. Wouldn't it be better to use a more > constant constant for this purpose? Yeah, in a green field that would have been the thing to do, but at this point it's years too late to change it. If there are any platforms where AF_INET is different from 2, changing those constants would break both on-disk storage and binary-format dumps for them. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs