Tom Lane írta:
Zoltan Boszormenyi <[EMAIL PROTECTED]> writes:
we at Cybertec have developed cast functions in C between
inet/cidr <-> bytea for a client and we would like to submit it.


Why is this a good idea?  Exposing the internal representation of a
datatype is usually bad.

I didn't expose the inet/cidr internals.

An IP address is an IP address whether you represent it
textually or as a series of bytes. Since the rise of the CIDR
type netmask usage, there is not much support for netmasks
with holes in the middle of the bits, like 255.255.192.128
on the 'net. And there is no support for this kind of netmask
in PostgreSQL either. So, to don't lose data (the netmask _is_
an important data) we decided to go this way.
A single IP address without the netmask means the netmask
covers the whole 32 or 128 bits in real life, too.

  What will you do when we add support for
scoped IPv6 addressing, to take one obvious example?

It can still be represented as a series of bytes, won't it?
Just as in an actual IP packet header.
When the support arrives, I can fix the cast, too, if needed.

                        regards, tom lane

Best regards

--
----------------------------------
Zoltán Böszörményi
Cybertec Geschwinde & Schönig GmbH
http://www.postgresql.at/


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to