Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1f238e5

Browse files
committed
Eliminate unnecessary array[] decoration in examples of recursive cycle
detection.
1 parent e3b0117 commit 1f238e5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

doc/src/sgml/queries.sgml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/queries.sgml,v 1.48 2008/10/13 16:25:19 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/queries.sgml,v 1.49 2008/10/14 00:12:44 tgl Exp $ -->
22

33
<chapter id="queries">
44
<title>Queries</title>
@@ -1639,7 +1639,7 @@ WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS (
16391639
FROM graph g
16401640
UNION ALL
16411641
SELECT g.id, g.link, g.data, sg.depth + 1,
1642-
path || ARRAY[g.id],
1642+
path || g.id,
16431643
g.id = ANY(path)
16441644
FROM graph g, search_graph sg
16451645
WHERE g.id = sg.link AND NOT cycle
@@ -1664,7 +1664,7 @@ WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS (
16641664
FROM graph g
16651665
UNION ALL
16661666
SELECT g.id, g.link, g.data, sg.depth + 1,
1667-
path || ARRAY[ROW(g.f1, g.f2)],
1667+
path || ROW(g.f1, g.f2),
16681668
ROW(g.f1, g.f2) = ANY(path)
16691669
FROM graph g, search_graph sg
16701670
WHERE g.id = sg.link AND NOT cycle

src/test/regress/expected/with.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ insert into graph values
465465
with recursive search_graph(f, t, label, path, cycle) as (
466466
select *, array[row(g.f, g.t)], false from graph g
467467
union all
468-
select g.*, path || array[row(g.f, g.t)], row(g.f, g.t) = any(path)
468+
select g.*, path || row(g.f, g.t), row(g.f, g.t) = any(path)
469469
from graph g, search_graph sg
470470
where g.f = sg.t and not cycle
471471
)

src/test/regress/sql/with.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ insert into graph values
266266
with recursive search_graph(f, t, label, path, cycle) as (
267267
select *, array[row(g.f, g.t)], false from graph g
268268
union all
269-
select g.*, path || array[row(g.f, g.t)], row(g.f, g.t) = any(path)
269+
select g.*, path || row(g.f, g.t), row(g.f, g.t) = any(path)
270270
from graph g, search_graph sg
271271
where g.f = sg.t and not cycle
272272
)

0 commit comments

Comments
 (0)