Skip site navigation (1) Skip section navigation (2)

Re: Subselects lack functionality

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: winnie(at)hoth(dot)amu(dot)edu(dot)pl, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Subselects lack functionality
Date: 2000-09-29 04:11:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
pgsql-bugs(at)postgresql(dot)org writes:
> Subselects don't allow one to use tuple set operators like UNION,

Yeah, we know.  The existing implementation of UNION etc. is a horrid
kluge that only works at the top level of a SELECT (and not even very
well there).  Fixing this will require a redesign of querytrees, which
is currently planned for 7.2.

> It would be gr8 if single column subselects would allow themselves to
> be treated the same way as lists do as right-side arguments of IN
> operator.

As Lamar pointed out, this works now.

> Subselects cannot be used as arguments to aggregation functions

You have that backwards.  You don't do the select as an argument to
the aggregate, you use it as a context for the aggregate, eg

	 ... (SELECT max(foo) FROM bar WHERE baz) ...

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2000-09-29 05:57:25
Subject: /contrib/soundex doesn't work. Version 7.0.2
Previous:From: Lamar OwenDate: 2000-09-28 22:20:52
Subject: Re: Subselects lack functionality

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group