Re: [SQL] Updating cidr column with network operator

2005-09-27 Thread Axel Rau
Am 27.09.2005 um 17:02 schrieb Daryl Richter: Ok, I guess, but isn't tit true now that you can insert a new address row which doesn't belong to any valid network?? Yes, I can. But in the earlier approach, the fk pointed at a special row in network ("UNKNOWN"), which maks no big difference. I

Re: [SQL] Updating cidr column with network operator

2005-09-27 Thread Daryl Richter
[EMAIL PROTECTED] wrote: Am 27.09.2005 um 16:02 schrieb Daryl Richter: An attribute is redundant if it repeats a fact that can be learned without it. If one table contains IP addresses and another contains networks, then you can associate IP addresses and networks with a join of the two

Re: [SQL] Updating cidr column with network operator

2005-09-27 Thread Axel Rau
Am 27.09.2005 um 16:02 schrieb Daryl Richter: > An attribute is redundant if it repeats a fact that can be learned > without it. If one table contains IP addresses and another contains > networks, then you can associate IP addresses and networks with a > join of the two tables; indeed, this is h

Re: [SQL] Updating cidr column with network operator

2005-09-27 Thread Daryl Richter
Michael Fuhr wrote: > On Mon, Sep 26, 2005 at 12:34:59PM +0200, Axel Rau wrote: > >>Am 26.09.2005 um 02:05 schrieb Michael Fuhr: >> >>>On Fri, Sep 23, 2005 at 09:19:25PM +0200, Axel Rau wrote: >>> I'm sure this would be the cleanest solution but remember networks change. >>> >>>Yes, which

Re: [SQL] Updating cidr column with network operator

2005-09-26 Thread Michael Fuhr
On Mon, Sep 26, 2005 at 12:34:59PM +0200, Axel Rau wrote: > Am 26.09.2005 um 02:05 schrieb Michael Fuhr: > > On Fri, Sep 23, 2005 at 09:19:25PM +0200, Axel Rau wrote: > > > I'm sure this would be the cleanest solution but remember networks > > > change. > > > > Yes, which is why it's a good idea to

Re: [SQL] Updating cidr column with network operator

2005-09-26 Thread Axel Rau
Am 26.09.2005 um 02:05 schrieb Michael Fuhr: On Fri, Sep 23, 2005 at 09:19:25PM +0200, Axel Rau wrote: Am 23.09.2005 um 19:32 schrieb Michael Fuhr: On Fri, Sep 23, 2005 at 06:31:17PM +0200, Axel Rau wrote: Networks change during time, being diveded or aggregated or you just enter wrong data

Re: [SQL] Updating cidr column with network operator

2005-09-25 Thread Michael Fuhr
On Fri, Sep 23, 2005 at 09:19:25PM +0200, Axel Rau wrote: > Am 23.09.2005 um 19:32 schrieb Michael Fuhr: > > On Fri, Sep 23, 2005 at 06:31:17PM +0200, Axel Rau wrote: > > > Networks change during time, being diveded or aggregated or you just > > > enter wrong data during insert. > > > > Have you co

Re: [SQL] Updating cidr column with network operator

2005-09-23 Thread Axel Rau
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 23.09.2005 um 20:43 schrieb Daryl Richter: [snip] I think that I now see what the problem is --> Why do you have a network table at all? It's redundant. There are more attributes and fks, I didn't mention to simplify. The schema is events ->

Re: [SQL] Updating cidr column with network operator

2005-09-23 Thread Axel Rau
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 23.09.2005 um 19:32 schrieb Michael Fuhr: On Fri, Sep 23, 2005 at 06:31:17PM +0200, Axel Rau wrote: Networks change during time, being diveded or aggregated or you just enter wrong data during insert. Have you considered using a CHECK constra

Re: [SQL] Updating cidr column with network operator

2005-09-23 Thread Daryl Richter
Axel Rau wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 22.09.2005 um 22:26 schrieb Daryl Richter: Axel Rau wrote: Thank you for responding, Daryl, Am 22.09.2005 um 16:45 schrieb Daryl Richter: Axel Rau wrote: Hi SQLers, I have a fk from address to network and try to update the

Re: [SQL] Updating cidr column with network operator

2005-09-23 Thread Michael Fuhr
On Fri, Sep 23, 2005 at 06:31:17PM +0200, Axel Rau wrote: > Networks change during time, being diveded or aggregated or you just > enter wrong data during insert. Have you considered using a CHECK constraint and/or a trigger to ensure that the network in the network column contains the address in

Re: [SQL] Updating cidr column with network operator

2005-09-23 Thread Axel Rau
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 22.09.2005 um 22:26 schrieb Daryl Richter: Axel Rau wrote: Thank you for responding, Daryl, Am 22.09.2005 um 16:45 schrieb Daryl Richter: Axel Rau wrote: Hi SQLers, I have a fk from address to network and try to update the foreign key colum

Re: [SQL] Updating cidr column with network operator

2005-09-22 Thread Daryl Richter
Axel Rau wrote: Thank you for responding, Daryl, Am 22.09.2005 um 16:45 schrieb Daryl Richter: Axel Rau wrote: Hi SQLers, I have a fk from address to network and try to update the foreign key column to point at the network, "it belongs to": CREATE TABLE network ( id cidr PRIMARY

Re: [SQL] Updating cidr column with network operator

2005-09-22 Thread Axel Rau
Thank you for responding, Daryl, Am 22.09.2005 um 16:45 schrieb Daryl Richter: Axel Rau wrote: Hi SQLers, I have a fk from address to network and try to update the foreign key column to point at the network, "it belongs to": CREATE TABLE network ( id cidr PRIMARY KEY , -- 'PK,

Re: [SQL] Updating cidr column with network operator

2005-09-22 Thread Daryl Richter
Axel Rau wrote: Hi SQLers, I have a fk from address to network and try to update the foreign key column to point at the network, "it belongs to": CREATE TABLE network ( id cidr PRIMARY KEY , -- 'PK, ,IPv4/6 Network address' ) CREATE TABLE address ( id inet PRIMAR

[SQL] Updating cidr column with network operator

2005-09-22 Thread Axel Rau
Hi SQLers, I have a fk from address to network and try to update the foreign key column to point at the network, "it belongs to": CREATE TABLE network ( id cidr PRIMARY KEY , -- 'PK, ,IPv4/6 Network address' ) CREATE TABLE address ( id inet PRIMARY KEY , -