Received: from ucs.co.za (ucs.co.za [196.23.43.2]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eA1Buwl44286 for ; Wed, 1 Nov 2000 06:56:59 -0500 (EST) (envelope-from gaf@ucs.co.za) Received: from ucspost.ucs.co.za (IDENT:root@mailgw1.ucs.co.za [196.23.43.254]) by ucs.co.za (8.9.3/8.9.3) with ESMTP id OAA08258; Wed, 1 Nov 2000 14:07:35 +0200 Received: from jhb.ucs.co.za (jhb.ucs.co.za [172.31.1.73]) by ucspost.ucs.co.za (8.9.3/8.7.3) with ESMTP id NAA13963; Wed, 1 Nov 2000 13:56:28 +0200 Received: from ucs.co.za (IDENT:gaf@pc141.ucs.co.za [172.31.1.141]) by jhb.ucs.co.za (8.9.3/8.8.7) with ESMTP id OAA00425; Wed, 1 Nov 2000 14:01:36 +0200 Message-ID: <3A0004EA.3E7724F6@ucs.co.za> Date: Wed, 01 Nov 2000 13:56:27 +0200 From: Grant Finnemore X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Marc Rohloff CC: pgsql-sql@postgresql.org Subject: Re: Outer Joins References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.postgresql.org id eA1Bv4l44298 X-Archive-Number: 200011/4 X-Sequence-Number: 35 Marc, I did not look at your queries, but outer joins are supported in the latest development version of PostgreSQL, and will be supported in the upcoming 7.1 release of the software - beta due soon. Regards, Grant Marc Rohloff wrote: > I've been looking at the open-source databases for a project I am working on and while reading about Postgres I saw that they do not support outer joins yet. I was intrigued by their solution of using a union query. > > Something Like: > select a.col1, b.col2 from a,b where a.col1 = b.col2 > union > select a.col1, NULL from a where a.col1 not in (select b.col2 from b) > > But I was wondering if the following would work (it does in some other databases) > > select a.col1, b.col2 from a,b > where a.col1 = b.col2 > or b.col2 is null > > or maybe even > > select a.col1, b.col2 from a,b > where a.col1 = b.col2 > or a.col1 not in (select b.col2 from b) > > These would seem to be far more efficient than a union query > (I would try this but I don't have a Unix box at the moment to install PostgreSQL on!) > > Marc Rohloff -- > Poorly planned software requires a genius to write it > and a hero to use it. Grant Finnemore BSc(Eng) (mailto:gaf@ucs.co.za) Software Engineer Universal Computer Services Tel (+27)(11)712-1366 PO Box 31266 Braamfontein 2017, South Africa Cell (+27)(82)604-5536 20th Floor, 209 Smit St., Braamfontein Fax (+27)(11)339-3421 Johannesburg, South Africa