Re: Common Table Expressions (WITH RECURSIVE) patch

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Tatsuo Ishii <ishii(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Common Table Expressions (WITH RECURSIVE) patch
Date: 2008-09-16 16:41:19
Message-ID: 1221583279.28645.38.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2008-09-15 at 22:41 -0700, David Fetter wrote:
> On Mon, Sep 15, 2008 at 06:46:16PM +0900, Tatsuo Ishii wrote:
> > > > * Single Evaluation:
> > > >
> > > > with
> > > > foo(i) as (select random() as i)
> > > > select * from foo union all select * from foo;
> > > > i
> > > > -------------------
> > > > 0.233165248762816
> > > > 0.62126633618027
> > > > (2 rows)
> > > >
> > > > The standard specifies that non-recursive WITH should be
> > > > evaluated once.
> > >
> > > What shall we do? I don't think there's an easy way to fix this as
> > > Tom suggested. Maybe we should not allow WITH clause without
> > > RECURISVE for 8.4?
> >
> > This is a still remaing issue...
>
> I don't think that the spec explicitly forbids this.
>

This has been discussed before.

Regardless of the nuances of the spec (and whether it says so explicitly
or implicitly), there are people in the community that see single
evaluation as important, and important enough to be a showstopper.

Tom Lane has suggested that this is a reasonable amount of work to
complete, and minor in comparison to the rest of the patch.

I think the right approach is to try to complete it so that everyone is
happy. I will work on this, but unfortunately I don't have a lot of time
right now, so I can't make any promises.

The rest of the patch looks good so far (there are still a few things I
want to look at), so I think this is the biggest open issue.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-09-16 17:18:14 Re: Subtransaction commits and Hot Standby
Previous Message Alvaro Herrera 2008-09-16 16:36:50 Re: 84 Wishlist update