Re: Wire protocol encoding for 'inet' type is defined unreliably

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Duncan Smith <Duncan(at)xrtc(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Wire protocol encoding for 'inet' type is defined unreliably
Date: 2015-03-26 15:31:51
Message-ID: 8169.1427383911@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Duncan Smith <Duncan(at)xrtc(dot)net> writes:
> I noticed today that the network encoding of the 'inet' type uses values
> derived from the system header file <sys/socket.h> to tag whether the
> address is IPv4 or IPv6.

> In particular, <src/include/utils/inet.h> 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2015-03-26 18:47:33 Re: BUG #12896: Unable to export data from Postgresql database
Previous Message Zachary Wincek 2015-03-26 13:19:40 Re: [BUGS] BUG #12902: The PostgreSQL repository lacks the pg_top package.