Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] cidr

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] cidr
Date: 1998-07-21 15:18:59
Message-ID: 24028.901034339@sss.pgh.pa.us (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-hackers
Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> writes:
>> Would it make sense to use atttypmod to distinguish several different
>> subtypes of CIDR?  "4 bytes", "4 bytes + mask", "6 bytes", "6 bytes
>> + mask" seem like interesting possibilities.

> Yes, that is the proper way to go, though atttypmod is something on
> column, not on each data row.  It is specified when the column is
> created.

Right, that's what I had in mind.  If you *know* that every entry in
your table only needs IPv4, you can specify that when making the table
and save a couple of bytes per entry.

The alternative solution is to make CIDR a variable-length type, but
I think the overhead of that would be as much or more than the possible
savings, no?

I don't know whether having multiple top-level types would be better
or worse than one type with a subtype code.

			regards, tom lane

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 1998-07-21 15:23:17
Subject: Re: [HACKERS] Re: Complexity of contrib types
Previous:From: Tom LaneDate: 1998-07-21 15:14:21
Subject: Re: [HACKERS] cvs and empty directories

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group