For the sake of discussion, I'll disagree here.  The PostgreSQL
implementation of macaddr is perfectly fine.

However, I feel there are some shortcomings of the cidr and inet data types:

1) They both take either 7 or 19 bytes of storage (depending on
whether you store v4 or v6 IP addresses.  This seems a waste to me.
After all, we were originally discussing this based on a finding that
using BIGINT vs INT UNSIGNED was wasteful.  I think I would prefer to
see an ipv4 type and an ipv6 type, with fixed sizes of 4 bytes and 16
bytes respectively.

2) The inet data type is not a unique data type, but rather a CHECK
CONSTRAINT on the cidr data type.  Drizzle doesn't support CHECK
CONSTRAINT definitions in SQL currently.  I'm not sure adding another
data type that is merely a check constraint on the cidr type is really
necessary.  This would certainly be a lower-priority task :)

BTW, PostgreSQL experts on the ML, please do let me know if I have
made a mistake above or am not understanding something properly.  I'm
a huge PG fan and I'm not knocking PG at all.  Just proposing an
alternative. :)

Cheers!

jay


On Sat, Mar 27, 2010 at 3:06 AM, Brian Aker <[email protected]> wrote:
> Hi!
>
> On Mar 26, 2010, at 11:20 PM, Siqi Guo wrote:
>
>> . In my opinion, it is necessary to bring in IP types (fields), it is both
>> convenient for users and cost-saving. That's also what Postgres did by
>> introducing "macaddr", "inet" and "cidr" data types.
>
> Yes, in general I believe we should match what PG did.
>
> A patch for this was written at least twice for MySQL, and they never got
> committed. I'd love to see us break this trend :)
>
> There is a little bit of work that needs to be done to make this happen.
> Namely the matrix of field translations needs to be removed from field.cc.
>
> Cheers,
>        -Brian
>
> Cheers,
>        -Brian
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to     : [email protected]
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help   : https://help.launchpad.net/ListHelp
>

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to