From 1f238e569acbc2a41be497d4fe1b1b797e5ae902 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 14 Oct 2008 00:12:44 +0000 Subject: [PATCH] Eliminate unnecessary array[] decoration in examples of recursive cycle detection. --- doc/src/sgml/queries.sgml | 6 +++--- src/test/regress/expected/with.out | 2 +- src/test/regress/sql/with.sql | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/queries.sgml b/doc/src/sgml/queries.sgml index 0232d80db71..ef9383a2f71 100644 --- a/doc/src/sgml/queries.sgml +++ b/doc/src/sgml/queries.sgml @@ -1,4 +1,4 @@ - + Queries @@ -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 e8d3e43b7b6..765910d48ba 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 d37f0d9723e..3107cbcb911 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 )