Received: from th00.opsion.fr (th00.opsion.fr [195.219.20.10]) by postgresql.org (Postfix) with SMTP id 1575B47586D for ; Thu, 11 Apr 2002 07:09:19 -0400 (EDT) Received: from 10.1.1.17 [10.1.1.17] by th00.opsion.fr id 200204111109.12ab; Thu, 11 Apr 2002 11:09:18 GMT Send-By: 202.181.138.12 with Mozilla/4.78 [en] (Win95; U) To: Subject: Problem With A Rule From: X-Priority: 3 (normal) MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Thu, 11 Apr 2002 11:09:18 GMT Message-id: <200204111109.12ab@th00.opsion.fr> X-Archive-Number: 200204/131 X-Sequence-Number: 7396 Hi! When the following rule is created: CREATE RULE rule1 AS ON UPDATE TO table1 DO UPDATE table2 SET column7=3D130 WHERE column10=3DNEW.column10=20 AND column1=3D(SELECT column1 FROM table3=20 WHERE column10=3DNEW.column10 AND column4=3D'N' AND column5=3DNEW.column1) AND column6=3D'2' AND column8=3DOLD.column7 AND column9=3DOLD.column2; then postgresql seems to be confused by the following SQL such that psql keeps waiting for postgresql's result: update table1 set column6=3D130 where column2=3D1; I have to ctrl-c psql to wake up psql. However, the following rule works without problem: CREATE RULE rule1 AS ON UPDATE TO table1 DO UPDATE table2 SET column7=3D130 WHERE column10=3DNEW.column10=20 AND column1=3D'OneConstant' AND column6=3D'2' AND column8=3DOLD.column7 AND column9=3DOLD.column2; The following SQL also works fine: update table2 set column7=3D130 where column10=3D'1'=20 and column1=3D(SELECT column1 FROM table3 WHERE column10=3D'1' AND column4=3D'N' AND column5=3D'ID1') and column6=3D'2' and column8=3D'r' and column9=3D1; Does rule has problem with subselect or the above problematic rule has bug? Regards, cn -------------------------------------------------------- You too can have your own email address from Eurosport. http://www.eurosport.com