Re: WITH support

Lists: pgsql-hackers
From: Edwin Ramirez <edwin(dot)ramirez(at)mssm(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: WITH support
Date: 2006-12-26 17:50:19
Message-ID: 459160DB.3000101@mssm.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello,

What is the status of supporting the "WITH" keyword?

--
Edwin S. Ramirez, Senior Developer
Information Technology Department - ITDC
Mount Sinai Medical Center
edwin(dot)ramirez(at)mssm(dot)edu * 646-217-3112


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Edwin Ramirez <edwin(dot)ramirez(at)mssm(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2006-12-29 03:52:45
Message-ID: 200612290352.kBT3qjN06645@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Edwin Ramirez wrote:
> Hello,
>
> What is the status of supporting the "WITH" keyword?

I see these TODO items:

* Add SQL99 WITH clause to SELECT
* Add SQL:2003 WITH RECURSIVE (hierarchical) queries to SELECT

Are they the same item? Someone has said they will do RECURSIVE for
8.3, but there is no guarantee.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Hubert FONGARNAND <informatique(dot)internet(at)fiducial(dot)fr>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Edwin Ramirez <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2006-12-29 09:06:31
Message-ID: 1167383191.8632.8.camel@hublinux.fidudev.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello,

I can see : WITH RECURSIVE hierarchical queries (Jonah H. Harris) in :

http://developer.postgresql.org/index.php/Todo:WishlistFor83

GREAT!!!

Such feature is very important, because it is supported in most of
commercial database
SQL Server 2003 support WITH RECURSIVE
DB2 support it too (WITH RECURSIVE has been invented by IBM)
Oracle support CONNECT BY (which is not standard, but very easier to use
compare to WITH RECURSIVE)

PostGreSQL would be the first opensource database supporting
hierarchical queries...

Today we use the "CONNECT BY" patch made by evgen potemkin
http://gppl.moonbone.ru/, it works well on 8.1...
But we are ready to drop it if WITH RECURSIVE is integrated!!!

It would be great to open a page on the developper wiki on this subject?

Sincerely

Hubert FONGARNAND

_____ _ _ _ _ ____ _ __ __ _
| ___(_) __| |_ _ ___(_) __ _| | / ___|| |_ __ _ / _|/ _(_)_ __ __ _
| |_ | |/ _` | | | |/ __| |/ _` | | \___ \| __/ _` | |_| |_| | '_ \ / _` |
| _| | | (_| | |_| | (__| | (_| | | ___) | || (_| | _| _| | | | | (_| |
|_| |_|\__,_|\__,_|\___|_|\__,_|_| |____/ \__\__,_|_| |_| |_|_| |_|\__, |
|___/

Le jeudi 28 décembre 2006 à 22:52 -0500, Bruce Momjian a écrit :

> Edwin Ramirez wrote:
> > Hello,
> >
> > What is the status of supporting the "WITH" keyword?
>
> I see these TODO items:
>
> * Add SQL99 WITH clause to SELECT
> * Add SQL:2003 WITH RECURSIVE (hierarchical) queries to SELECT
>
> Are they the same item? Someone has said they will do RECURSIVE for
> 8.3, but there is no guarantee.
>
>
_______________________________________________
Ce message et les ventuels documents joints peuvent contenir des informations confidentielles.
Au cas o il ne vous serait pas destin, nous vous remercions de bien vouloir le supprimer et en aviser immdiatement l'expditeur. Toute utilisation de ce message non conforme sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'tant pas scurises, l'intgrit de ce message n'est pas assure et la socit mettrice ne peut tre tenue pour responsable de son contenu.


From: David Fetter <david(at)fetter(dot)org>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Edwin Ramirez <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2006-12-29 12:53:50
Message-ID: 20061229125350.GA3332@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Dec 28, 2006 at 10:52:45PM -0500, Bruce Momjian wrote:
> Edwin Ramirez wrote:
> > Hello,
> >
> > What is the status of supporting the "WITH" keyword?
>
> I see these TODO items:
>
> * Add SQL99 WITH clause to SELECT
> * Add SQL:2003 WITH RECURSIVE (hierarchical) queries to SELECT
>
> Are they the same item?

Not exactly. There is a WITH in the SQL:2003 spec (T121 and T122)
which doesn't include RECURSIVE, but they're related to the RECURSIVE
one (T131).

> Someone has said they will do RECURSIVE for 8.3, but there is no
> guarantee.

Is there code for this yet? Who's the someone? :)

Cheers,
D
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: Edwin Ramirez <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2006-12-29 15:13:27
Message-ID: 200612291513.kBTFDRf02360@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Fetter wrote:
> On Thu, Dec 28, 2006 at 10:52:45PM -0500, Bruce Momjian wrote:
> > Edwin Ramirez wrote:
> > > Hello,
> > >
> > > What is the status of supporting the "WITH" keyword?
> >
> > I see these TODO items:
> >
> > * Add SQL99 WITH clause to SELECT
> > * Add SQL:2003 WITH RECURSIVE (hierarchical) queries to SELECT
> >
> > Are they the same item?
>
> Not exactly. There is a WITH in the SQL:2003 spec (T121 and T122)
> which doesn't include RECURSIVE, but they're related to the RECURSIVE
> one (T131).
>
> > Someone has said they will do RECURSIVE for 8.3, but there is no
> > guarantee.
>
> Is there code for this yet? Who's the someone? :)

No code yet, and I don't remember who said they were working on it.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "David Fetter" <david(at)fetter(dot)org>, "Edwin Ramirez" <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2006-12-30 05:49:19
Message-ID: 36e682920612292149n167dbd97wa77102a1e34eeb17@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 12/29/06, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> No code yet, and I don't remember who said they were working on it.

I'm still waiting to hear from Mark Cave-Ayland on whether he's going
to pick it up or whether I'll just do it. One way or another, there
should be some movement regarding design discussion within a week or
two.

--
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 3rd Floor | jharris(at)enterprisedb(dot)com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/


From: Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>
To: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, David Fetter <david(at)fetter(dot)org>, Edwin Ramirez <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2006-12-30 16:56:15
Message-ID: 1167497775.11039.17.camel@mca-desktop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, 2006-12-30 at 00:49 -0500, Jonah H. Harris wrote:
> On 12/29/06, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> > No code yet, and I don't remember who said they were working on it.
>
> I'm still waiting to hear from Mark Cave-Ayland on whether he's going
> to pick it up or whether I'll just do it. One way or another, there
> should be some movement regarding design discussion within a week or
> two.

Hi everyone,

Sorry to come in late on this discussion - I've been playing catch-up
with emails over the festive season...

The situation regarding WITH support is that it's something which I am
picking up in my spare time (out of work hours) and so unfortunately
progress isn't as rapid as I would like. See here for my last meaningful
patch and Tom's feedback:
http://archives.postgresql.org/pgsql-patches/2006-09/msg00260.php. The
idea was to first implement just the WITH clause itself as a first
patch, and then extend to include the recursive features with a
secondary patch.

In short, if people don't mind waiting for my free cycles to come along
then I will continue to chip away at it; otherwise if it's considered an
essential for 8.3 with an April deadline then I will happily hand over
to Jonah.

Kind regards,

Mark.


From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Mark Cave-Ayland" <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "David Fetter" <david(at)fetter(dot)org>, "Edwin Ramirez" <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2007-01-03 01:08:11
Message-ID: 36e682920701021708q45cb86c6r8cd55d6bb5a27f7e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 12/30/06, Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk> wrote:
> In short, if people don't mind waiting for my free cycles to come along
> then I will continue to chip away at it; otherwise if it's considered an
> essential for 8.3 with an April deadline then I will happily hand over
> to Jonah.

I'd say it's probably essential given my last, shall we say, "mishap".
So I guess I'll start up discussion on the design again soon. I'm
leaving in a couple days to travel up to NJ so expect discussion to
start again on Tuesday of next week.

As always, I too wouldn't have a problem if someone else is going to
see it through for 8.3.

--
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 3rd Floor | jharris(at)enterprisedb(dot)com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/


From: Hubert FONGARNAND <informatique(dot)internet(at)fiducial(dot)fr>
To: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>, Bruce Momjian <bruce(at)momjian(dot)us>, David Fetter <david(at)fetter(dot)org>, Edwin Ramirez <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2007-01-03 08:45:30
Message-ID: 1167813930.12638.5.camel@hublinux.fidudev.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Le mardi 02 janvier 2007 à 18:08 -0700, Jonah H. Harris a écrit :

> On 12/30/06, Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk> wrote:
> > In short, if people don't mind waiting for my free cycles to come along
> > then I will continue to chip away at it; otherwise if it's considered an
> > essential for 8.3 with an April deadline then I will happily hand over
> > to Jonah.
>
> I'd say it's probably essential given my last, shall we say, "mishap".
> So I guess I'll start up discussion on the design again soon. I'm
> leaving in a couple days to travel up to NJ so expect discussion to
> start again on Tuesday of next week.
>
> As always, I too wouldn't have a problem if someone else is going to
> see it through for 8.3.
>

Why not looking at http://gppl.moonbone.ru/ evgen potemkin. has ever
made a patch for WITH and CONNECT BY?

I'm ready to test these features... (RECURSIVE) when they'll land in
CVS...

Hubert FONGARNAND
_______________________________________________
Ce message et les ventuels documents joints peuvent contenir des informations confidentielles.
Au cas o il ne vous serait pas destin, nous vous remercions de bien vouloir le supprimer et en aviser immdiatement l'expditeur. Toute utilisation de ce message non conforme sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'tant pas scurises, l'intgrit de ce message n'est pas assure et la socit mettrice ne peut tre tenue pour responsable de son contenu.


From: Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>
To: Hubert FONGARNAND <informatique(dot)internet(at)fiducial(dot)fr>
Cc: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, David Fetter <david(at)fetter(dot)org>, Edwin Ramirez <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2007-01-03 09:15:41
Message-ID: 1167815741.5545.34.camel@mca-desktop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, 2007-01-03 at 09:45 +0100, Hubert FONGARNAND wrote:

> Why not looking at http://gppl.moonbone.ru/ evgen potemkin. has ever
> made a patch for WITH and CONNECT BY?
>
> I'm ready to test these features... (RECURSIVE) when they'll land in
> CVS...

Hi Hubert,

IIRC there were two issues - firstly the license for the patch was GPL
as opposed to BSD used for PostgreSQL, and secondly I believe Tom and
some of the other developers were not happy with some of the internal
changes made by the patch. Fortunately it looks as if Jonah can commit
some serious time to this, so your offer of helping to test when the
code hits CVS is gratefully received :)

Kind regards,

Mark.


From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Hubert FONGARNAND" <informatique(dot)internet(at)fiducial(dot)fr>
Cc: "Mark Cave-Ayland" <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "David Fetter" <david(at)fetter(dot)org>, "Edwin Ramirez" <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2007-01-03 23:19:19
Message-ID: 36e682920701031519p27842136r9d6b3a58e86f1606@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 1/3/07, Hubert FONGARNAND <informatique(dot)internet(at)fiducial(dot)fr> wrote:
> Why not looking at http://gppl.moonbone.ru/ evgen potemkin. has ever made a
> patch for WITH and CONNECT BY?

Nope, no good. This is what I started with last time and the
refactoring attempt at WITH is just too massive. As for CONNECT BY,
PostgreSQL does not want the syntax, they want ANSI/ISO WITH
[RECURSIVE]... so even starting there isn't great.

This is really something that needs to be decided on before
implementation... or it will probably never get in.

--
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 3rd Floor | jharris(at)enterprisedb(dot)com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/


From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "Mark Cave-Ayland" <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>
Cc: "Hubert FONGARNAND" <informatique(dot)internet(at)fiducial(dot)fr>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "David Fetter" <david(at)fetter(dot)org>, "Edwin Ramirez" <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2007-01-03 23:21:54
Message-ID: 36e682920701031521q7626e59bhd223d3fe198c4949@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 1/3/07, Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk> wrote:
> IIRC there were two issues - firstly the license for the patch was GPL
> as opposed to BSD used for PostgreSQL

Yes, however Evgen was kind enough to grant me a BSD license for it
should I get it committed into PostgreSQL. However, with the amount
of refactoring and community design decisions to be made, I doubt any
of the patch would be usable.

> ... secondly I believe Tom and some of the other developers were not
> happy with some of the internal changes made by the patch.

Yes, there are numerous bug reports from patched versions especially
on Gentoo. As for the WITH support, it was written for PostgreSQL
7.2/7.3 and was a basic preliminary proof-of-concept.

--
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 3rd Floor | jharris(at)enterprisedb(dot)com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/


From: David Fetter <david(at)fetter(dot)org>
To: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: Hubert FONGARNAND <informatique(dot)internet(at)fiducial(dot)fr>, Mark Cave-Ayland <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>, Bruce Momjian <bruce(at)momjian(dot)us>, Edwin Ramirez <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2007-01-03 23:23:33
Message-ID: 20070103232333.GI28334@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Jan 03, 2007 at 04:19:19PM -0700, Jonah H. Harris wrote:
> On 1/3/07, Hubert FONGARNAND <informatique(dot)internet(at)fiducial(dot)fr> wrote:
> >Why not looking at http://gppl.moonbone.ru/ evgen potemkin. has
> >ever made a patch for WITH and CONNECT BY?
>
> Nope, no good. This is what I started with last time and the
> refactoring attempt at WITH is just too massive. As for CONNECT BY,
> PostgreSQL does not want the syntax, they want ANSI/ISO WITH
> [RECURSIVE]... so even starting there isn't great.
>
> This is really something that needs to be decided on before
> implementation... or it will probably never get in.

As I recall, it was decided long ago, and the conclusions were:

* Only BSD-compatibly licensed code goes in PostgreSQL's code base,

and

* PostgreSQL will only support the SQL:2003 standard WITH (RECURSIVE)
syntax in the main line code.

Cheers,
D
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!


From: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
To: "David Fetter" <david(at)fetter(dot)org>
Cc: "Hubert FONGARNAND" <informatique(dot)internet(at)fiducial(dot)fr>, "Mark Cave-Ayland" <mark(dot)cave-ayland(at)ilande(dot)co(dot)uk>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Edwin Ramirez" <edwin(dot)ramirez(at)mssm(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WITH support
Date: 2007-01-03 23:24:57
Message-ID: 36e682920701031524w2c47b114kdd1e91591d90e921@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 1/3/07, David Fetter <david(at)fetter(dot)org> wrote:
> As I recall, it was decided long ago, and the conclusions were:
> * Only BSD-compatibly licensed code goes in PostgreSQL's code base,
> * PostgreSQL will only support the SQL:2003 standard WITH (RECURSIVE)
> syntax in the main line code.

Yes, see later response :)

--
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 3rd Floor | jharris(at)enterprisedb(dot)com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/