Re: Recursive queries?

Lists: pgsql-hackers
From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Recursive queries?
Date: 2004-02-04 20:08:13
Message-ID: 200402041208.13237.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Chris, Robert

> As a side note, I thought Joe Conway also had an implementation of
> this...

Yes, we already have a connect_by function, and have had since 7.3. Look
in /contrib/tablefuc.

I think that's as far as we want to go implementing Oracle's syntax, though
*external* patches are of course good for GBorg. If we're to implement
recursive queries, we should implement the SQL99 standard.

--
-Josh Berkus
Aglio Database Solutions
San Francisco


From: Neil Conway <neilc(at)samurai(dot)com>
To: josh(at)agliodbs(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Recursive queries?
Date: 2004-02-04 20:26:47
Message-ID: 87ekta1th4.fsf@mailbox.samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Josh Berkus <josh(at)agliodbs(dot)com> writes:
> I think that's as far as we want to go implementing Oracle's syntax

Why do you think that?

> If we're to implement recursive queries, we should implement the
> SQL99 standard.

Granted, the primary goal should be implementing the SQL99 syntax, but
providing syntax-level compatibility with Oracle's syntax (provided it
isn't too difficult) seems like a good idea to me.

-Neil


From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Recursive queries?
Date: 2004-02-04 20:48:44
Message-ID: 200402041248.44222.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Neil,

> Granted, the primary goal should be implementing the SQL99 syntax, but
> providing syntax-level compatibility with Oracle's syntax (provided it
> isn't too difficult) seems like a good idea to me.

I don't agree. There are lots of non-standard things which Oracle does (outer
joins come to mind); supporting them just because Oracle does them would be
giving our allegiance to Oracle instead of ANSI as the standard-setter for
SQL. I would happily support an Oracle compatibility parser as an *optional
add-in* to PostgreSQL for people porting applications, but for the general
user we should be promoting standard syntax wherever it is reasonable to do
so.

Also, for all we know Oracle may have patented "connect by". And for that
matter, why just Oracle? Why not MS SQL Server & Sybase? Why not DB2?

Now, maybe there's an argumen that "CONNECT BY" supplies some sort of
functionality that the SQL99 standard is missing, which would be persuasive;
we have included sequences and LIMIT, after all. But even then I would
question the term; I've never found "CONNECT BY" to be particularly
intuitive. "RECURSIVE JOIN" would make far more sense.

--
-Josh Berkus
Aglio Database Solutions
San Francisco