pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: stefano@sportilia.com
To: pgsql-bugs@postgresql.org
Subject: BUG #7653: Minor problem with join condition
Date: Mon, 12 Nov 2012 10:14:49 +0000
Message-ID: <E1TXr2X-000080-UB@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      7653
Logged by:          Stefano Baccianella
Email address:      stefano@sportilia.com
PostgreSQL version: 9.2.1
Operating system:   Linux CentOS
Description:        

Don't know if this is a bug or a correct behaviour, but in a query like
this:

SELECT t1.* FROM
table1 t1 JOIN
table2 t2 ON t1.id = t2.t1id JOIN
table3 t3 ON t1.id = t2.t1id

The parser should return an error because we are joining a table without
using any of its column.

I know this is a minor issue and a correct SQL syntax, but logically a JOIN
without condition is a Cartesian product between the two tables and not a
JOIN.
My proposal is to raise an error when a join condition doesn't contains the
table reference.

Regards





view thread (2+ messages)  latest in thread

Message-ID: <E1TXr2X-000080-UB@wrigleys.postgresql.org>
Permalink:  ../E1TXr2X-000080-UB@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1TXr2X-000080-UB@wrigleys.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: stefano@sportilia.com
  Subject: Re: BUG #7653: Minor problem with join condition
  In-Reply-To: <E1TXr2X-000080-UB@wrigleys.postgresql.org>
  References: <E1TXr2X-000080-UB@wrigleys.postgresql.org>

* 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