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

Re: [PATCHES] WITH RECUSIVE patches 0717

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: david(at)fetter(dot)org
Cc: ishii(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us, er(at)xs4all(dot)nl, pgsql-patches(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org, y-asaba(at)sraoss(dot)co(dot)jp
Subject: Re: [PATCHES] WITH RECUSIVE patches 0717
Date: 2008-07-21 01:13:58
Message-ID: 20080721.101358.68047354.t-ishii@sraoss.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
> On Mon, Jul 21, 2008 at 08:19:35AM +0900, Tatsuo Ishii wrote:
> > > > Thus I think we should avoid this kind of ORDER BY. Probably we should
> > > > avoid LIMIT/OFFSET and FOR UPDATE as well.
> > > 
> > > What of index-optimized SELECT max(...) ?
> > 
> > Aggregate functions in a recursive term is prohibited by the
> > standard. For example, 
> > 
> > WITH RECURSIVE x(n) AS (SELECT 1 UNION ALL SELECT max(n) FROM x)
> >   SELECT * FROM x;
> > 
> > produces an error.
> 
> On the other side of UNION ALL, it's OK, right?  For example,
> 
> WITH RECURSIVE x(n) AS (
>     SELECT max(i) FROM t
> UNION ALL
>     SELECT n+1 FROM x WHERE n < 20
> )

Yes, aggregate functions in the non-recursive term is allowed by the
standard.
--
Tatsuo Ishii
SRA OSS, Inc. Japan

In response to

pgsql-hackers by date

Next:From: Radek StrnadDate: 2008-07-21 01:15:56
Subject: Re: [WIP] collation support revisited (phase 1)
Previous:From: David FetterDate: 2008-07-21 00:00:05
Subject: Re: [PATCHES] WITH RECUSIVE patches 0717

pgsql-patches by date

Next:From: Stephen FrostDate: 2008-07-21 01:18:29
Subject: Re: pg_dump additional options for performance
Previous:From: David FetterDate: 2008-07-21 00:00:05
Subject: Re: [PATCHES] WITH RECUSIVE patches 0717

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