Johannes Bauer <dfnsonfsduifb (AT) gmx (DOT) de> wrote:
Quote:
Hello group,
I'm playing around with triggers. What I want to achieve is a table of
subnets. All subnets should be disjoint, network is of type cidr. E.g.
The following should not be possible:
INSERT INTO subnets (network) VALUES ('192.168.1.0/24');
INSERT INTO subnets (network) VALUES ('192.168.0.0/16');
As the latter includes the former completely. It shall not be possible
in reverse order, either. Therefore, I started up with a simple type of
check (currently only checks if network is a certain parameter to try
around, later this will be replaced by the "real" check): |
I'm not familiar with this data-type, but i think there are some
functions and operators for this, see:
http://www.postgresql.org/docs/curre...tions-net.html
Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°