From the DOC
The essential difference between inet and cidr data types is that inet accepts values with nonzero bits to the right of the netmask, whereas cidr does not.
Please give me example for differences of cidr and inet datatypes in PostgreSQL.
I do not understand that completely and want to see differences visually.
Seems I have found the answer
Say, if you have a /8 netmask, the cidr type requires that all the
24 rightmost bits are zero. inet does not have this requirement.
db=# select '255.0.0.0/8'::cidr;
255.0.0.0/8
db=# select '255.1.0.0/8'::cidr;
ERROR: invalid cidr value: "255.1.0.0/8"
DETAIL: Value has bits set to right of mask.
And inet allows this:
db=# select '255.1.0.0/8'::inet;
255.1.0.0/8