On Fri, 22 Nov 2002 15:21:48 -0800
Joe Conway <mail@joeconway.com> wrote:
> OK. Attached patch removes calls within the function to quote_ident, requiring
> the user to appropriately quote their own identifiers. I also tweaked the
> regression test to deal with "value" becoming a reserved word.
>
> If it's not too late, I'd like this to get into 7.3, but in any case, please
> apply to HEAD.
>
Thank you for your quick job.
Regards,
Masaru Sugawara
-------------------------------------
CREATE SCHEMA ms;
CREATE TABLE ms.test (id int4, parent_id int4, t text);
INSERT INTO ms.test VALUES(11, null, 'aaa');
INSERT INTO ms.test VALUES(101, 11, 'bbb');
INSERT INTO ms.test VALUES(110, 11, 'ccc');
INSERT INTO ms.test VALUES(111, 110, 'ddd');
SELECT *FROM connectby('ms.test', 'id', 'parent_id', '11', 0, '.') as t(id int, parent_id int, level int,
branchtext);
id | parent_id | level | branch
-----+-----------+-------+------------ 11 | | 0 | 11101 | 11 | 1 | 11.101110 | 11 |
1| 11.110111 | 110 | 2 | 11.110.111
(4 rows)
------------------------------------
CREATE SCHEMA "MS";
drop table "MS"."Test";
CREATE TABLE "MS"."Test" (id int4, parent_id int4, t text);
INSERT INTO "MS"."Test" VALUES(22, null, 'aaa');
INSERT INTO "MS"."Test" VALUES(202, 22, 'bbb');
INSERT INTO "MS"."Test" VALUES(220, 22, 'ccc');
INSERT INTO "MS"."Test" VALUES(222, 220, 'ddd');
SELECT *FROM connectby('"MS"."Test"', 'id', 'parent_id', '22', 0, '.') as t(id int, parent_id int, level int,
branchtext);
id | parent_id | level | branch
-----+-----------+-------+------------ 22 | | 0 | 22202 | 22 | 1 | 22.202220 | 22 |
1| 22.220222 | 220 | 2 | 22.220.222
(4 rows)