Re: [SQL] special integrity constraints

2004-03-22 Thread Achilleus Mantzios
O kyrios Erik Thiele egrapse stis Mar 22, 2004 : Could it be possible to convert *any* CHECK constraint problem into an equivalent DEFERRABLE FK constraint problem? That is for *every* CHECK CONSTRAINT cc create (and maintain) 2 additional 1 row tables (cc1(val),cc2(val)) in such a way that cc i

Re: [SQL] special integrity constraints

2004-03-22 Thread Bruno Wolff III
On Mon, Mar 22, 2004 at 17:21:21 +0100, Erik Thiele <[EMAIL PROTECTED]> wrote: > > there is no such thing as a deferred check constraint: > > DEFERRABLE > NOT DEFERRABLE > > This controls whether the constraint can be deferred. A constraint that > is not deferrable will be checked immediately

Re: [SQL] special integrity constraints

2004-03-22 Thread Erik Thiele
On Mon, 22 Mar 2004 09:12:11 -0600 Bruno Wolff III <[EMAIL PROTECTED]> wrote: > On Mon, Mar 22, 2004 at 14:10:42 +0100, > Erik Thiele <[EMAIL PROTECTED]> wrote: > > > > it means (((count_rows(a)+count_rows(b)) modulo 2) == 0) > > OK, that means my FK suggestion won't help. The other suggestion

Re: [SQL] special integrity constraints

2004-03-22 Thread Stephan Szabo
On Mon, 22 Mar 2004, Erik Thiele wrote: > On Mon, 22 Mar 2004 06:21:28 -0800 (PST) > Stephan Szabo <[EMAIL PROTECTED]> wrote: > > > > > On Mon, 22 Mar 2004, Erik Thiele wrote: > > > > However, foreign keys are implemented using "constraint triggers". They're > > really not documented much (because

Re: [SQL] special integrity constraints

2004-03-22 Thread Erik Thiele
On Mon, 22 Mar 2004 06:21:28 -0800 (PST) Stephan Szabo <[EMAIL PROTECTED]> wrote: > > On Mon, 22 Mar 2004, Erik Thiele wrote: > > > On Mon, 22 Mar 2004 12:13:29 +0200 (EET) > > Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > > > > > O kyrios Erik Thiele egrapse stis Mar 22, 2004 : > > > > > > Di

Re: [SQL] special integrity constraints

2004-03-22 Thread Bruno Wolff III
On Mon, Mar 22, 2004 at 14:10:42 +0100, Erik Thiele <[EMAIL PROTECTED]> wrote: > > it means (((count_rows(a)+count_rows(b)) modulo 2) == 0) OK, that means my FK suggestion won't help. The other suggestion about putting triggers on "a" and "b" to update a count in another table that has a deferr

Re: [SQL] special integrity constraints

2004-03-22 Thread Stephan Szabo
On Mon, 22 Mar 2004, Erik Thiele wrote: > On Mon, 22 Mar 2004 12:13:29 +0200 (EET) > Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > > > O kyrios Erik Thiele egrapse stis Mar 22, 2004 : > > > > Did you check out the DEFERRABLE option on the constraint? > > > > DEFERRABLE > NOT DEFERRABLE > > This

Re: [SQL] special integrity constraints

2004-03-22 Thread Erik Thiele
On Mon, 22 Mar 2004 05:26:04 -0600 Bruno Wolff III <[EMAIL PROTECTED]> wrote: > On Mon, Mar 22, 2004 at 10:20:31 +0100, > Erik Thiele <[EMAIL PROTECTED]> wrote: > > hi, > > > > i have two tables > > > > create table a (x integer); > > create table b (y real); > > > > i have the special constr

Re: [SQL] special integrity constraints

2004-03-22 Thread Achilleus Mantzios
O kyrios Erik Thiele egrapse stis Mar 22, 2004 : > On Mon, 22 Mar 2004 12:13:29 +0200 (EET) > Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > > > O kyrios Erik Thiele egrapse stis Mar 22, 2004 : > > > > Did you check out the DEFERRABLE option on the constraint? > > > > DEFERRABLE > NOT DEFERRA

Re: [SQL] special integrity constraints

2004-03-22 Thread Bruno Wolff III
On Mon, Mar 22, 2004 at 10:20:31 +0100, Erik Thiele <[EMAIL PROTECTED]> wrote: > hi, > > i have two tables > > create table a (x integer); > create table b (y real); > > i have the special constraint that the sum of the number of rows in > table a plus the number of rows in table b must be eve

Re: [SQL] special integrity constraints

2004-03-22 Thread Erik Thiele
On Mon, 22 Mar 2004 12:13:29 +0200 (EET) Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > O kyrios Erik Thiele egrapse stis Mar 22, 2004 : > > Did you check out the DEFERRABLE option on the constraint? > DEFERRABLE NOT DEFERRABLE This controls whether the constraint can be deferred. A constrain

Re: [SQL] special integrity constraints

2004-03-22 Thread Achilleus Mantzios
O kyrios Erik Thiele egrapse stis Mar 22, 2004 : Did you check out the DEFERRABLE option on the constraint? > hi, > > i have two tables > > create table a (x integer); > create table b (y real); > > i have the special constraint that the sum of the number of rows in > table a plus the number o

[SQL] special integrity constraints

2004-03-22 Thread Erik Thiele
hi, i have two tables create table a (x integer); create table b (y real); i have the special constraint that the sum of the number of rows in table a plus the number of rows in table b must be even. so there is a posibility of adding one element to a and one element to b, and again the constra