X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id AAFF2D1C4B8 for ; Mon, 28 Jul 2003 05:31:35 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 69938-01 for ; Mon, 28 Jul 2003 02:30:40 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 74500D1C4B7 for ; Mon, 28 Jul 2003 02:31:33 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h6S5VTQ3027091; Mon, 28 Jul 2003 01:31:29 -0400 (EDT) To: Oliver Duke-Williams Cc: pgsql-sql@postgresql.org Subject: Re: Can a table have a reference to itself? In-reply-to: <3F1E9F6E.2090600@geog.leeds.ac.uk> References: <3F1E9F6E.2090600@geog.leeds.ac.uk> Comments: In-reply-to Oliver Duke-Williams message dated "Wed, 23 Jul 2003 15:45:02 +0100" Date: Mon, 28 Jul 2003 01:31:29 -0400 Message-ID: <27090.1059370289@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/411 X-Sequence-Number: 14525 Oliver Duke-Williams writes: > So far so good, but what I'd like to do is to be able to change a value > of a, and have this cascaded to b; however this gives an integrity > violation error: >> update foo set a = 5 where a = 2; > ERROR: chk_a referential integrity violation - key referenced from foo > not found in foo Seems to work in 7.3.4 and CVS tip: regression=# update foo set a = 5 where a = 2; UPDATE 1 regression=# select * from foo; a | b ---+--- 1 | 1 3 | 5 5 | 5 (3 rows) regards, tom lane