Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
1f238e56
Commit
1f238e56
authored
Oct 14, 2008
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate unnecessary array[] decoration in examples of recursive cycle
detection.
parent
e3b01174
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
doc/src/sgml/queries.sgml
doc/src/sgml/queries.sgml
+3
-3
src/test/regress/expected/with.out
src/test/regress/expected/with.out
+1
-1
src/test/regress/sql/with.sql
src/test/regress/sql/with.sql
+1
-1
No files found.
doc/src/sgml/queries.sgml
View file @
1f238e56
<!-- $PostgreSQL: pgsql/doc/src/sgml/queries.sgml,v 1.4
8 2008/10/13 16:25:19
tgl Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/queries.sgml,v 1.4
9 2008/10/14 00:12:44
tgl Exp $ -->
<chapter id="queries">
<chapter id="queries">
<title>Queries</title>
<title>Queries</title>
...
@@ -1639,7 +1639,7 @@ WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS (
...
@@ -1639,7 +1639,7 @@ WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS (
FROM graph g
FROM graph g
UNION ALL
UNION ALL
SELECT g.id, g.link, g.data, sg.depth + 1,
SELECT g.id, g.link, g.data, sg.depth + 1,
path ||
ARRAY[g.id]
,
path ||
g.id
,
g.id = ANY(path)
g.id = ANY(path)
FROM graph g, search_graph sg
FROM graph g, search_graph sg
WHERE g.id = sg.link AND NOT cycle
WHERE g.id = sg.link AND NOT cycle
...
@@ -1664,7 +1664,7 @@ WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS (
...
@@ -1664,7 +1664,7 @@ WITH RECURSIVE search_graph(id, link, data, depth, path, cycle) AS (
FROM graph g
FROM graph g
UNION ALL
UNION ALL
SELECT g.id, g.link, g.data, sg.depth + 1,
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)
ROW(g.f1, g.f2) = ANY(path)
FROM graph g, search_graph sg
FROM graph g, search_graph sg
WHERE g.id = sg.link AND NOT cycle
WHERE g.id = sg.link AND NOT cycle
...
...
src/test/regress/expected/with.out
View file @
1f238e56
...
@@ -465,7 +465,7 @@ insert into graph values
...
@@ -465,7 +465,7 @@ insert into graph values
with recursive search_graph(f, t, label, path, cycle) as (
with recursive search_graph(f, t, label, path, cycle) as (
select *, array[row(g.f, g.t)], false from graph g
select *, array[row(g.f, g.t)], false from graph g
union all
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
from graph g, search_graph sg
where g.f = sg.t and not cycle
where g.f = sg.t and not cycle
)
)
...
...
src/test/regress/sql/with.sql
View file @
1f238e56
...
@@ -266,7 +266,7 @@ insert into graph values
...
@@ -266,7 +266,7 @@ insert into graph values
with
recursive
search_graph
(
f
,
t
,
label
,
path
,
cycle
)
as
(
with
recursive
search_graph
(
f
,
t
,
label
,
path
,
cycle
)
as
(
select
*
,
array
[
row
(
g
.
f
,
g
.
t
)],
false
from
graph
g
select
*
,
array
[
row
(
g
.
f
,
g
.
t
)],
false
from
graph
g
union
all
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
from
graph
g
,
search_graph
sg
where
g
.
f
=
sg
.
t
and
not
cycle
where
g
.
f
=
sg
.
t
and
not
cycle
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment