classful cidr insertion bug?

From: Paul Schultz <pschultz(at)pschultz(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: classful cidr insertion bug?
Date: 2002-06-17 00:35:22
Message-ID: Pine.LNX.4.44.0206162014160.3821-100000@elvis.kravshera.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


I'm running into an issue that contradicts how pgsql should behave
according to the documentation. Running 7.2.1 .deb package.

For the cidr data type it says an insertion missing the subnet bits should
be handled like legacy classful networks. ie if I insert just
'172.16.0.0' it should be handled as '172.16.0.0/16'. I'm seeing it get
inserted as '172.16.0.0/32'.

If i insert using for example '172.16' it works and inserts as a /16, so
does classful insertion only work when inputting with an abbreviated
network (and why the choice to have it restricted like that)? The data
being stored is essentially a selective parsing of an entire BGP table
from a Cisco router, so legacy class a/b/c space with 8/16/24 bit
netmasks respectively show up without the prefix length bits.

niara=# \d prefixes
Table "prefixes"
Column | Type | Modifiers
-----------+------------------------+-----------------------------------------------------
prefix | cidr |
aspath | character varying(200) |
origin_as | integer |
id | integer | not null default
nextval('"prefixes_id_seq"'::text)
Unique keys: prefixes_id_key

niara=# insert into prefixes values ('129.10.0.0', '10913 1239 1 i', '1');
INSERT 415033 1
niara=# select prefix from prefixes where prefix = '129.10.0.0';
prefix
---------------
129.10.0.0/32
(1 row)

Thanks,

Paul Schultz

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-06-17 03:27:39 Re: classful cidr insertion bug?
Previous Message Tomoyuki Niijima 2002-06-16 12:14:14 Apache 1.3.19 could not load libpq.so of PostgreSQL 7.2.1