Re: [HACKERS] Re: subselects

From: The Hermit Hacker <scrappy(at)hub(dot)org>
To: "Vadim B(dot) Mikheev" <vadim(at)sable(dot)krasnoyarsk(dot)su>
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, hackers(at)postgreSQL(dot)org, "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Subject: Re: [HACKERS] Re: subselects
Date: 1998-01-10 18:51:56
Message-ID: Pine.NEB.3.96.980110144716.259B-100000@thelab.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 11 Jan 1998, Vadim B. Mikheev wrote:

> > > No, I don't like to add anything in parser. Example:
> > >
> > > select *
> > > from tabA
> > > where col1 = (select col2
> > > from tabB
> > > where tabA.col3 = tabB.col4
> > > and exists (select *
> > > from tabC
> > > where tabB.colX = tabC.colX and
> > > tabC.colY = tabA.col2)
> > > )
> > >
> > > : a column of tabA is referenced in sub-subselect
> >
> > This is a strange case that I don't think we need to handle in our first
> > implementation.
>
> I don't know is this strange case or not :)
> But I would like to know is this allowed by standards - can someone
> comment on this ?
> And I don't see problems with handling this...

I don't know about "the standards", but in my mind, the above should
work if subselects work...so what if you add a third or fourth level subselect
to the overall query? IMHO, the "outer most" (inner most?) subselect should
be resolved to provide the "EXISTS" list, the the next should be resolved,
etc...

Hell...looking at this, I'd almost think that you could use subselects to
force a pseudo-ordering onto a large complex JOIN (ya ya, really messy though)

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy(at)hub(dot)org secondary: scrappy(at){freebsd|postgresql}.org

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-01-10 19:31:29 Re: [HACKERS] Re: subselects
Previous Message The Hermit Hacker 1998-01-10 18:45:36 Re: [HACKERS] Can't run current PostgreSQL