> > There is a bug in check_foreign_key of refint.c which is bundled with
authorBruce Momjian
Tue, 6 Oct 1998 03:12:59 +0000 (03:12 +0000)
committerBruce Momjian
Tue, 6 Oct 1998 03:12:59 +0000 (03:12 +0000)
> > the standard distribution. It occurs when a trigger calling this
> > function recursively fires another trigger which calls the same
> > function. The calling check_foreign_key loses its plan informantion and
> > when it tries to use it the backend closes its channel. You can check it
> > with the sql script I am attaching below.
> > The solution to this is to do a find_plan again before executing it at
> > line 483 of refint.c.
> > Therefore two more lines should be added before line 483:

Anand Surelia

contrib/spi/refint.c
doc/src/sgml/ref/pg_dump.sgml

index 954e12c59055f616eb151bc7a9eaa91c58477db2..ca9ffa728811c9718ae9e30b62427d4d3a7980e4 100644 (file)
@@ -480,6 +480,8 @@ check_foreign_key()
 
        relname = args[0];
 
+       sprintf(ident, "%s$%u", trigger->tgname, rel->rd_id);
+       plan = find_plan(ident, &FPlans, &nFPlans);
        ret = SPI_execp(plan->splan[r], kvals, NULL, tcount);
        /* we have no NULLs - so we pass   ^^^^  here */
 
index 89974eaa8da59b35129ef7ee45dc34ad3492f3fe..7e3d44292d78e3b99b382500af111361d5dade48 100644 (file)
@@ -281,13 +281,13 @@ catalogs.
 
 
 
-rules and views
+rules
 
 
 pg_dump 
-does not understand user-defined rules and views and
+does not understand user-defined rules and
 will fail to dump them properly.  (This is due to the fact that
-rules are stored as plans in the catalogs and not textually).
+rules are stored as plans in the catalogs and not textually.)