pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: alexandre :: aldeia digital <alepaes@aldeiadigital.com.br>
To: pgsql-sql@postgresql.org
Subject: Outer Join with For Update
Date: Tue, 3 Sep 2002 15:05:41 -0300 (BRT)
Message-ID: <1507.200.225.214.1.1031076341.squirrel@webmail.aldeiadigital.com.br> (raw)

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







view thread (2+ messages)  latest in thread

Message-ID: <1507.200.225.214.1.1031076341.squirrel@webmail.aldeiadigital.com.br>
Permalink:  ../1507.200.225.214.1.1031076341.squirrel@webmail.aldeiadigital.com.br/
Also on:    postgresql.org/message-id/1507.200.225.214.1.1031076341.squirrel@webmail.aldeiadigital.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: alepaes@aldeiadigital.com.br
  Subject: Re: Outer Join with For Update
  In-Reply-To: <1507.200.225.214.1.1031076341.squirrel@webmail.aldeiadigital.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox