Received: from femail32.sdc1.sfba.home.com (femail32.sdc1.sfba.home.com [24.254.60.22]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8NKs8e30018 for ; Sun, 23 Sep 2001 16:54:08 -0400 (EDT) (envelope-from kway@overtone.org) Received: from bean.overtone.org ([24.249.254.100]) by femail32.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010923205404.MNWB844.femail32.sdc1.sfba.home.com@bean.overtone.org>; Sun, 23 Sep 2001 13:54:04 -0700 Received: by bean.overtone.org (Postfix, from userid 1001) id D55655B2D3; Sun, 23 Sep 2001 20:54:01 +0000 (GMT) Date: Sun, 23 Sep 2001 20:54:01 +0000 From: Kevin Way To: Josh Berkus Cc: pgsql-sql@postgresql.org Subject: Re: confounding, incorrect constraint error Message-ID: <20010923205400.A59842@bean.overtone.org> References: <20010923070945.A39397@bean.overtone.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from josh@agliodbs.com on Sun, Sep 23, 2001 at 01:31:33PM -0700 X-Archive-Number: 200109/194 X-Sequence-Number: 4876 --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > Below is a significantly simplified version of my schema, which > > exhibits > > the above problem. >=20 > Unfortunately, even a simplified version of your schema would take me > some hours to understand. As your rule-setting is quite complex, my > first instinct would be to hunt for circular procedural logic in your > rules. Try to pursue, step by step, everything that happens from the > moment you send the insert command to uservotes. You may find that the > logic cascades back to the beginning. I've done this to myself on > occasion, causing the DB to hang on a seemingly simple request. I'm fairly certain that there's no circular procedural logic. The errors can be turned on/off by turning on/off the uservote_ series of rules, which are attached to the uservote table. These rules call mod_node_vote_count which only touches the node table. There are no rules or triggers associated with the node table, so there is no circular logic there. Additional strangeness is that the itemvote_ series of rules works perfectly despite the fact that the only difference between uservote_ and itemvote_ rules is the table that triggers them, they both call the same procedure on the nodes table. My current thinking is that something is stomping on some memory, because= =20 you can vary the effect of the error from being an incorrectly failed CHECK constraint, to crashing the database, by varying the number of columns in the tables in question. I'm unemployed at the moment and this is a pet project, so I can't offer much in the way of financial compensation, but I'll start the bidding at $50 donation in your name to your choice of the EFF, the Red Cross, or the American Cancer Society, in return for a fix. (If none of these charities are acceptable, surely one can be found later that is acceptable to both parties). Again, I greatly appreciate any help, and I apologize that my test case is still fairly sizeable, despite being about 10% the size of the original code. -Kevin Way --d6Gm4EdcadzBjdND Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7rkvoKxA01iDoLN4RAl9jAKCej2Ahn+YPa2rNCGHKu40k6q22nwCcCHJ3 P3/TxcqsIOcZ4Z8KJRSeaJ4= =STsr -----END PGP SIGNATURE----- --d6Gm4EdcadzBjdND--