Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id EA4084763D8 for ; Tue, 3 Sep 2002 14:04:18 -0400 (EDT) Received: from spirit.aldeiadigital.com.br (iplus-fac-137.xdsl-fixo.ctbcnetsuper.com.br [200.225.213.137]) by postgresql.org (Postfix) with ESMTP id 9A907476433 for ; Tue, 3 Sep 2002 14:04:15 -0400 (EDT) Received: from aldeiadigital.com.br (localhost.localdomain [127.0.0.1]) by spirit.aldeiadigital.com.br (8.11.6/8.11.4) with SMTP id g83I5fL03211 for ; Tue, 3 Sep 2002 15:05:41 -0300 Received: from 200.225.214.1 (proxying for 192.168.1.156) (SquirrelMail authenticated user alepaes) by webmail.aldeiadigital.com.br with HTTP; Tue, 3 Sep 2002 15:05:41 -0300 (BRT) Message-ID: <1507.200.225.214.1.1031076341.squirrel@webmail.aldeiadigital.com.br> Date: Tue, 3 Sep 2002 15:05:41 -0300 (BRT) Subject: Outer Join with For Update From: "alexandre :: aldeia digital" To: X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal X-Mailer: SquirrelMail (version 1.2.7) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/14 X-Sequence-Number: 9291 Hi all, I work with a case tool named Genexus. This tool generate the applications in VB, VFox, Java, C, etc. in DB2, Oracle, M$ SQL and now supports postgresql in VB and JAVA generator, making a good job (excepting when it use a "optimize for", "/*fastfirstrows*/" or "fast(n)" for the other 3 DB ... postgresql does not have this optimization clauses, making certains querys slow when compared with others). But I found a problem (this query is the same for DB2 and postgres and the database tables/data are equal): SELECT A.id, B.desc from A left join B ON B.id=A.id FOR UPDATE OF A,B If I have a null rellation in B, the error in postgres is: "SELECT FOR UPDATE cannot be applied to the nullable side of an OUTER JOIN" DB2 simply ignore the FOR UPDATE ... I think that is the correct form...I donīt know when the LEFT ou RIGHT JOIN will be null... I remove the check in initsplan.c (line 324/325), but postgres returns : "ERROR: ExecutePlan: (junk) `ctid2' is NULL!" Like other case tools, I donīt have the possibility to change the query in code forever... Any tips?!?! Thankīs all and sorry for this big email and a poor english... :) Alexandre Arruda Paes Aldeia Digital Brazil