dbTalk Databases Forums  

Trigger problem

comp.databases.postgresql comp.databases.postgresql


Discuss Trigger problem in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Trigger problem - 08-31-2008 , 02:41 PM






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°


Reply With Quote
  #12  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Trigger problem - 08-31-2008 , 02:41 PM






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°


Reply With Quote
  #13  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Trigger problem - 08-31-2008 , 02:41 PM



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°


Reply With Quote
  #14  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Trigger problem - 08-31-2008 , 02:41 PM



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°


Reply With Quote
  #15  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Trigger problem - 08-31-2008 , 02:41 PM



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°


Reply With Quote
  #16  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Trigger problem - 08-31-2008 , 02:41 PM



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°


Reply With Quote
  #17  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Trigger problem - 08-31-2008 , 02:41 PM



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°


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.