Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126

    Unanswered: Common table expressions ?

    Just downloaded and installed the latest version of PostgreSQL for MS-Windows.
    To my surprise, I found out that common table expressions (CTEs) are not (yet) supported!
    Are there plans to add this SQL-99 feature to PostgreSQL in the near future?

    Example:
    Code:
    WITH c (x) AS (SELECT col1 FROM mytable WHERE condition)
    SELECT a.x, b.x
    FROM   c AS a INNER JOIN c AS b ON a.x < b.x
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  2. #2
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    That, I don't know. Probably the best place to find out future development direction of postgresql is at PostgreSQL.org - maybe here: http://archives.postgresql.org/
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  3. #3
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    Quote Originally Posted by loquin
    That, I don't know. Probably the best place to find out future development direction of postgresql is at PostgreSQL.org - maybe here: http://archives.postgresql.org/
    Thanks!
    I did indeed find some discussions in the pgsql-hackers list to this end.
    They seem to indicate that (1) full CTE support will not be there before version 8.4; and (2) maybe partial support could be there earlier; a "beta" version is already there (somewhere ?).

    -- Peter.
    Quote Originally Posted by Gregory_Stark
    Re: WITH/RECURSIVE plans
    Date: Thu, 08 Mar 2007 00:40:16 +0000

    "Simon Riggs" <simon ( at ) 2ndquadrant ( dot ) com> writes:
    > On Fri, 2007-03-02 at 11:09 -0800, David Fetter wrote:
    >> On Fri, Mar 02, 2007 at 10:52:14AM -0800, Joshua D. Drake wrote:
    >> > Unfortunately we (the community) will not have WITH/RECURSIVE for 8.3. However I have spoken with Alexey and Alvaro and Command Prompt has decided to make WITH/RECURSIVE a priority for 8.4.
    >> Any chance we can get WITH without RECURSIVE? That would be very handy all by itself.
    > I thought Greg already did submit that?
    I thought so too. Except then I tested it on more complex examples and it didn't seem to work. Somehow the common table expression name wasn't being propagated into the scope of subqueries. If that were fixed then, yes, basically it's done.
    Last edited by Peter.Vanroose; 06-25-07 at 04:45.
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •