Re: [HACKERS] refinit, check_foreign_key() not working?

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Keith Parks <emkxp01(at)mtcc(dot)demon(dot)co(dot)uk>
Cc: hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] refinit, check_foreign_key() not working?
Date: 1998-01-09 02:56:48
Message-ID: 34B591F0.3486B7C1@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I seem to be getting a failure in the "triggers" regression tests in the
> latest CVS source.

I saw things like this yesterday (and they are in expected/triggers.out) but
today they seem to have gone away (the orig file in my diff below is from
today's distribution and the second file is today's result). The only "ERROR"
messages remaining are two reasonable ones.

I'll update the source tree for regression output soon (hopefully tonight). I am
seeing small differences in select_views.out, but afaict these are due to
changes in the backend but are still producing a valid result. One thing which
is confusing is that the "<" operator for paths is currently just counting nodes
on the path. Funny enough there is an old comment from the original implementors
saying that it is a kludge and they will change it. I'm planning on changing
this to compare the lengths of the paths instead (a bit more intuitive I think).

- Tom

golem$ diff triggers.out.orig triggers.out
43d42
< ERROR: check_fkeys2_pkey_exist: tuple references non-existing key in pkeys
49d47
< ERROR: check_fkeys_pkey_exist: tuple references non-existing key in pkeys
51d48
< ERROR: check_fkeys_pkey2_exist: tuple references non-existing key in fkeys2
54c51
< ERROR: check_fkeys2_fkey_restrict: tuple referenced in fkeys
---
> NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys2 are deleted
60c57
< ERROR: check_fkeys2_fkey_restrict: tuple referenced in fkeys
---
> NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys2 are deleted
63a61
> ERROR: Cannot insert a duplicate key into a unique index
golem$

>
>
> I can't be 100% sure that this test worked before but now I'm seeing errors
> that would indicate check_foreign_key() is not working.
>
> Anyone else seeing this?
>
> Keith.
>
> --- expected/triggers.out Tue Jan 6 20:59:58 1998
> +++ results/triggers.out Thu Jan 8 18:08:12 1998
> @@ -40,27 +40,25 @@
> QUERY: insert into fkeys2 values (40, '4', 5);
> QUERY: insert into fkeys2 values (50, '5', 3);
> QUERY: insert into fkeys2 values (70, '5', 3);
> -ERROR: check_fkeys2_pkey_exist: tuple references non-existing key in pkeys
> QUERY: insert into fkeys values (10, '1', 2);
> QUERY: insert into fkeys values (30, '3', 3);
> QUERY: insert into fkeys values (40, '4', 2);
> QUERY: insert into fkeys values (50, '5', 2);
> QUERY: insert into fkeys values (70, '5', 1);
> -ERROR: check_fkeys_pkey_exist: tuple references non-existing key in pkeys
> QUERY: insert into fkeys values (60, '6', 4);
> -ERROR: check_fkeys_pkey2_exist: tuple references non-existing key in fkeys2
> QUERY: delete from pkeys where pkey1 = 30 and pkey2 = '3';
> NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys are deleted
> -ERROR: check_fkeys2_fkey_restrict: tuple referenced in fkeys
> +NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys2 are deleted
> QUERY: delete from pkeys where pkey1 = 40 and pkey2 = '4';
> NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys are deleted
> NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys2 are deleted
> QUERY: update pkeys set pkey1 = 7, pkey2 = '70' where pkey1 = 50 and pkey2 =
> '5';
> NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys are deleted
> -ERROR: check_fkeys2_fkey_restrict: tuple referenced in fkeys
> +NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys2 are deleted
> QUERY: update pkeys set pkey1 = 7, pkey2 = '70' where pkey1 = 10 and pkey2 =
> '1';
> NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys are deleted
> NOTICE: check_pkeys_fkey_cascade: 1 tuple(s) of fkeys2 are deleted
> +ERROR: Cannot insert a duplicate key into a unique index
> QUERY: DROP TABLE pkeys;
> QUERY: DROP TABLE fkeys;
> QUERY: DROP TABLE fkeys2;

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-01-09 03:55:03 subselects
Previous Message Vadim B. Mikheev 1998-01-09 02:50:54 Re: [HACKERS] Disk block size issues.