Re: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Don Baccus <dhogaza(at)pacifier(dot)com>, "Ansley, Michael" <Michael(dot)Ansley(at)intec(dot)co(dot)za>, "'The Hermit Hacker '" <scrappy(at)hub(dot)org>, "'Rod Chamberlin '" <rod(at)querix(dot)com>, "'pgsql-hackers(at)postgreSQL(dot)org '" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL
Date: 2000-01-07 07:24:01
Message-ID: 38759491.FD69EE66@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > select ...
> > from t1 inner join t4 on t1.x=t4.x,
> > t2 left outer join t1
> > on t2.y=t1.y and
> > (t1.start_date between t2.start_date and t1.start_date),
> > t3 left outer join t1 on t3.x=t1.x and t3.y = t1.y;
> Let's be honest, folks. This is almost unreadable. I think we will
> need some simpler way to access _outer_ in addition to the ANSI way.

Nonsense! Especially since this isn't quite SQL92. Here is an SQL92
query (I think ;) :

select a, b, c
from (t1 left join t2 using (x)) as j1 (a, b)
right join t3 on (j1.a = t3.y);

So you do a left join with t1 and t2, name the resulting intermediate
table and columns, and then do a right join of the result with t3. I
can't see other syntaxes being very much more obvious, particularly
wrt predicting the actual result. Just because a query looks simpler
doesn't necessarily mean that the syntax alway produces a more robust
query.

> I can't imagine how I would answer a question: "How do I do an ANSI
> outer join". It would need its own FAQ page.

Well, *you're* the one writing the book :))

- Thomas

--
Thomas Lockhart lockhart(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2000-01-07 07:35:57 (OT) Linux limits
Previous Message Ansley, Michael 2000-01-07 07:06:23 RE: [HACKERS] Enhancing PGSQL to be compatible with Informix SQL