Re: [HACKERS] WITH RECUSIVE patches 0723 - Mailing list pgsql-patches

From Tatsuo Ishii
Subject Re: [HACKERS] WITH RECUSIVE patches 0723
Date
Msg-id 20080726.122346.51295854.t-ishii@sraoss.co.jp
Whole thread Raw
In response to Re: [HACKERS] WITH RECUSIVE patches 0723  (David Fetter <david@fetter.org>)
List pgsql-patches
> Thanks for the patch :)
>
> Now, I get a different problem, this time with the following code
> intended to materialize paths on the fly and summarize down to a
> certain depth in a tree:
>
> CREATE TABLE tree(
>     id INTEGER PRIMARY KEY,
>     parent_id INTEGER REFERENCES tree(id)
> );
>
> INSERT INTO tree
> VALUES (1, NULL), (2, 1), (3,1), (4,2), (5,2), (6,2), (7,3), (8,3),
>        (9,4), (10,4), (11,7), (12,7), (13,7), (14, 9), (15,11), (16,11);
>
> WITH RECURSIVE t(id, path) AS (
>     VALUES(1,ARRAY[NULL::integer])
> UNION ALL
>     SELECT tree.id, t.path || tree.id
>     FROM tree JOIN t ON (tree.parent_id = t.id)
> )
> SELECT
>     t1.id, count(t2.*)
> FROM
>     t t1
> JOIN
>     t t2
> ON (
>     t1.path[1:2] = t2.path[1:2]
> AND
>     array_upper(t1.path,1) = 2
> AND
>     array_upper(t2.path,1) > 2
> )
> GROUP BY t1.id;
> ERROR: unrecognized node type: 203

Thanks for the report. Here is the new patches from Yoshiyuki against
CVS HEAD. Also I have added your test case to the regression test.

> Please apply the attached patch to help out with tab
> completion in psql.

Thanks. Your patches has been included.
--
Tatsuo Ishii
SRA OSS, Inc. Japan

Attachment

pgsql-patches by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: pg_dump additional options for performance
Next
From: Simon Riggs
Date:
Subject: Re: pg_dump additional options for performance