Re: New cast between inet/cidr and bytea

Поиск
Список
Период
Сортировка
От Zoltan Boszormenyi
Тема Re: New cast between inet/cidr and bytea
Дата
Msg-id 465E6217.7080008@cybertec.at
обсуждение исходный текст
Ответ на Re: New cast between inet/cidr and bytea  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane írta:
> Zoltan Boszormenyi <zb@cybertec.at> 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/



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Zoltan Boszormenyi
Дата:
Сообщение: Re: New cast between inet/cidr and bytea
Следующее
От: OmniPay Company
Дата:
Сообщение: Job Proposal