pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #7653: Minor problem with join condition
2+ messages / 2 participants
[nested] [flat]

* BUG #7653: Minor problem with join condition
@ 2012-11-12 10:14  stefano@sportilia.com
  0 siblings, 1 reply; 2+ messages in thread

From: stefano@sportilia.com @ 2012-11-12 10:14 UTC (permalink / raw)
  To: pgsql-bugs

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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #7653: Minor problem with join condition
@ 2012-11-12 14:30  Tom Lane <tgl@sss.pgh.pa.us>
  parent: stefano@sportilia.com
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2012-11-12 14:30 UTC (permalink / raw)
  To: stefano@sportilia.com; +Cc: pgsql-bugs

stefano@sportilia.com writes:
> 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.

There is no such restriction in the SQL standard.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-11-12 14:30 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-11-12 10:14 BUG #7653: Minor problem with join condition stefano@sportilia.com
2012-11-12 14:30 ` Tom Lane <tgl@sss.pgh.pa.us>

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