[ pgsql-advocacy trimmed from cc list; seems off-topic for them ]
"D'Arcy J.M. Cain" <darcy@druid.net> writes:
> On Thursday 30 January 2003 07:42, Gavin Sherry wrote:
>> Different storage for ipv4 vs. ipv6 (why punish ipv4 users with an extra
>> 96 bits of storage?). Use of ipv4 and ipv6 should be mutually
>> exclusive. Extra code in inet type causing bloat.
> The inet code has been designed from day one to handle ipv6. It was assumed
> that the extra glue would be added when it was needed. I don't see any
> reason to change that. I also don't think it adds an extra 12 bytes to ipv4
> addresses if you do. The type is variable size if I recall correctly.
Yes, it is; so the "extra storage" argument holds no water. And the
"code bloat" argument doesn't either, that I can see. It's not going to
take more code to incorporate ipv6 functionality as part of an existing
datatype than as part of a new datatype. (If anything, it should take
less code that way; you don't need any extra per-datatype overhead.)
> Certainly we don't want people to have two different fields for the
> same piece of information, an IP address.
That's the main argument in my mind. If a user *wants* to segregate
ipv4 and v6 addresses, he can do so in any case --- but if he'd rather
have a column that could be either kind, only the unified-datatype
approach will be convenient for him.
Why exactly should "use of ipv4 and ipv6 be mutually exclusive"?
I don't see the argument for that. (It'd have to be an argument that
doesn't just establish a scenario where you'd want that, but proves
that we should force that point of view upon every application using
IP addresses.)
regards, tom lane