diff options
author | Tom Lane | 2008-10-14 00:12:44 +0000 |
---|---|---|
committer | Tom Lane | 2008-10-14 00:12:44 +0000 |
commit | 1c0baaf0ca76e1eb529a1f6cdd47ad342378ca86 (patch) | |
tree | 0e152b3a8db6ac705377af0c7edd8f59d68edb35 | |
parent | c52c21a176e21bf40452c98df87f65ed1546993c (diff) |
Eliminate unnecessary array[] decoration in examples of recursive cycle
detection.
-rw-r--r-- | doc/src/sgml/queries.sgml | 4 | ||||
-rw-r--r-- | src/test/regress/expected/with.out | 2 | ||||
-rw-r--r-- | src/test/regress/sql/with.sql | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/doc/src/sgml/queries.sgml b/doc/src/sgml/queries.sgml index e07916defa..c53c385365 100644 --- a/doc/src/sgml/queries.sgml +++ b/doc/src/sgml/queries.sgml @@ -1639,7 +1639,7 @@ WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS ( FROM graph g UNION ALL SELECT g.id, g.link, g.data, sg.depth + 1, - path || ARRAY[g.id], + path || g.id, g.id = ANY(path) FROM graph g, search_graph sg WHERE g.id = sg.link AND NOT cycle @@ -1664,7 +1664,7 @@ WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS ( FROM graph g UNION ALL SELECT g.id, g.link, g.data, sg.depth + 1, - path || ARRAY[ROW(g.f1, g.f2)], + path || ROW(g.f1, g.f2), ROW(g.f1, g.f2) = ANY(path) FROM graph g, search_graph sg WHERE g.id = sg.link AND NOT cycle diff --git a/src/test/regress/expected/with.out b/src/test/regress/expected/with.out index e8d3e43b7b..765910d48b 100644 --- a/src/test/regress/expected/with.out +++ b/src/test/regress/expected/with.out @@ -465,7 +465,7 @@ insert into graph values with recursive search_graph(f, t, label, path, cycle) as ( select *, array[row(g.f, g.t)], false from graph g union all - select g.*, path || array[row(g.f, g.t)], row(g.f, g.t) = any(path) + select g.*, path || row(g.f, g.t), row(g.f, g.t) = any(path) from graph g, search_graph sg where g.f = sg.t and not cycle ) diff --git a/src/test/regress/sql/with.sql b/src/test/regress/sql/with.sql index d37f0d9723..3107cbcb91 100644 --- a/src/test/regress/sql/with.sql +++ b/src/test/regress/sql/with.sql @@ -266,7 +266,7 @@ insert into graph values with recursive search_graph(f, t, label, path, cycle) as ( select *, array[row(g.f, g.t)], false from graph g union all - select g.*, path || array[row(g.f, g.t)], row(g.f, g.t) = any(path) + select g.*, path || row(g.f, g.t), row(g.f, g.t) = any(path) from graph g, search_graph sg where g.f = sg.t and not cycle ) |