Re: LEFT JOIN used in psql describe.c - Mailing list pgsql-hackers

From Marc G. Fournier
Subject Re: LEFT JOIN used in psql describe.c
Date
Msg-id 20050510201339.T6493@ganymede.hub.org
Whole thread Raw
In response to Re: LEFT JOIN used in psql describe.c  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: LEFT JOIN used in psql describe.c  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
On Tue, 10 May 2005, Bruce Momjian wrote:

> Bruce Momjian wrote:
>> Tom Lane wrote:
>>> "Greg Sabino Mullane" <greg@turnstep.com> writes:
>>>>> Does anyone know why so many LEFT JOINs are used in psql/describe.c to
>>>>> join to the pg_namespace table, like here:
>>>
>>>> Yes, pg_relnamespace is definitely not null. I've actually already removed
>>>> the left joins from my \df patch, since I had to rewrite some of the
>>>> queries anyway. If this is wrong, please let me know of course!
>>>
>>> I think the idea was to be certain to show every pg_proc entry (or other
>>> catalog for other \d commands), no matter how badly broken the catalog
>>> interrelationships might be.  If there's not an unarguable reason
>>> for eliminating the left joins I'd be inclined to keep it like that.
>>> What does an inner join buy here, other than brittleness?
>>>
>>> (Yeah, I have the perspective of a developer who deals with broken
>>> situations every day.  So?)
>>
>> If we have problems with the system catalogs, I don't see how this join
>> has a high probability of catching the problem.  If there was some known
>> problem of the join not always working, I could see the use of LEFT
>> JOIN, but there isn't, so it just seems confusing, and these queries are
>> used by others as models of how to do system joins, so could confuse our
>> users as well.
>>
>> I think the LEFT JOIN should be removed unless there is a known problem,
>> and if one shows up, we can re-add them later.
>
> I still think that the LEFT JOINs used in psql system queries is
> confusing and perhaps adds performance overhead while adding little
> reliability, but no one else seems to think so so I will drop the idea.

I'm a bit confused here, but I believe Tom (at least how I read it) was 
agreeing with you about pulling the LEFT JOIN out ... "I think the LEFT 
JOIN should be removed unless there is a known problem, and if one shows 
up, we can re-add them later." ... or am I mis-quoting?

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy@hub.org           Yahoo!: yscrappy              ICQ: 7615664


pgsql-hackers by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Views, views, views: Summary of Arguments
Next
From: Palle Girgensohn
Date:
Subject: --enable-thread-safety?