Re: RFE: Use JOIN instead of WHERE in Graphical Query Builder

From: "Daniel Serodio (lists)" <daniel(dot)lists(at)mandic(dot)com(dot)br>
To: "Nelson A(dot) de Oliveira" <naoliv(at)gmail(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: RFE: Use JOIN instead of WHERE in Graphical Query Builder
Date: 2012-07-17 23:06:17
Message-ID: 5005EFE9.2090608@mandic.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Nelson A. de Oliveira wrote:
> Hi!
>
> On Tue, Jul 17, 2012 at 7:36 PM, Daniel Serodio (lists)
> <daniel(dot)lists(at)mandic(dot)com(dot)br> wrote:
>> I'm using pgAdmin 1.14.3, and its Graphical Query Builder generates WHERE
>> clauses for joins. It would be nice if it generated JOIN clauses instead.
>
> Is there any kind of difference between WHERE or JOINs in PostgreSQL?
> Aren't they all a cartesian product internally?
They may be implemented the same way in PostgresSQL, but they're two
different concepts. Because of this, I find it a lot easier to
understand a complex query when the joins are in a JOIN clause.

In more practical terms, it's easier to change "a JOIN b ON a.pk = b.fk"
to "a LEFT JOIN b ON a.pk = b.fk" (just have to type the LEFT keyword,
regardless of which tables/columns are used) then change "WHERE a.pk =
b.fk" to "WHERE a.pk = b.fk OR b.fk IS NULL" (have to add "OR b.fk IS
NULL", which changes according to which tables/columns are used).

Regards,
Daniel Serodio

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Michal Kozusznik 2012-07-18 06:24:18 Re: Search the schema
Previous Message Nelson A. de Oliveira 2012-07-17 22:40:07 Re: RFE: Use JOIN instead of WHERE in Graphical Query Builder