Re: New cast between inet/cidr and bytea

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Zoltan Boszormenyi <zb(at)cybertec(dot)at>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: New cast between inet/cidr and bytea
Date: 2007-05-31 16:18:11
Message-ID: 465EF543.8040109@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Zoltan Boszormenyi wrote:
>> Also: to the extent that the application is willing to deal with a
>> Postgres-specific inet/cidr representation (which, in the end, is
>> what this would be) it can do that *today* using binary output format.
>> So I'm still not seeing an argument for exposing a cast to bytea.
>>
>> regards, tom lane
>>
>
> But the binary output of inet/cidr needs another round of parsing
> which requires using internal server headers.
>
> Would you like a 4/8/16/32 byte output using IP only
> or IP + fully represented netmask better?
>
>

How are you getting the bytea output? If as text then you're going to be
doing parsing anyway; if as binary, why not just get the binary of the
base type directly? It is not clear to me why we should provide this
facility just for inet/cidr - if it is justified in that case it should
be required for all types.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-05-31 16:59:21 Re: Query plan degradation 8.2 --> 8.3
Previous Message Zoltan Boszormenyi 2007-05-31 16:03:12 Re: New cast between inet/cidr and bytea